Repository navigation
add static_assert to clang HALO functions to prevent silent HALO failure - #270
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivating example, which previously would compile, but HALO doesn't work - a task wrapper is generated internally which causes an allocation. This is most relevant in the "join streams" usage of mux, where an awaitable is being re-forked into the same slot repeatedly.
Now there is a static_assert that detects when the wrapper would be created internally, and directs you to use the newly added
tmc::as_taskwrapper function at the call site instead. Since this wrapper is created externally, it can be HALO'd.Note that this static_assert only fires then the awaitable mode is actually WRAPPER. In other cases, no wrapper is needed for allocation-free operation.