Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use DropWaker SubmissionQueue::cancel_op #139

Merged
merged 5 commits into from
Jul 21, 2024
Merged

Conversation

Thomasdezeeuw
Copy link
Owner

Instead of always using the Box implementation, meaning we always
allocate, we now require the caller to pass resources that implement
DropWaker.

This means we can avoid the allocation for various types that implement
DropWaker already.

Instead of always using the Box implementation, meaning we always
allocate, we now require the caller to pass resources that implement
DropWaker.

This means we can avoid the allocation for various types that implement
DropWaker already.

The downside is that in the case where we got no more events the
allocation is made upfront (for certain types) and then dropped, without
actually being in a waker.
A more action-y name for the trait, which matches the usual Rust trait
naming convention.
This is useful for the types that don't implement DropWake themselves
and thus have to use a Box. That Box allocation can now be delayed until
it's actually needed, which might not be needed if we expect no further
events for the submission.
@Thomasdezeeuw Thomasdezeeuw merged commit fbc6d84 into main Jul 21, 2024
6 checks passed
@Thomasdezeeuw Thomasdezeeuw deleted the better-drop-waker branch July 21, 2024 11:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant