-
-
Notifications
You must be signed in to change notification settings - Fork 25
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
Skip slots v2 #81
Skip slots v2 #81
Conversation
…_ref`) to this slot to be dropped. Add ability to `Core::push_ref` to skip such slots and attempt to reuse them on the next lap.
faddeb7
to
ad96a30
Compare
Hi @hawkw. I created this PR following your suggestions in #80 (to have both implementations available at the same time). If you prefer the approach from this PR, I can merge and stash/rebase all changes back into #80. Also, I rented a |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall, I definitely prefer this approach over the one proposed in #80. I had a handful of minor suggestions, most of which are just stylistic --- feel free to ignore most of them.
I do think we should ensure the new slow loom models are added to the list of slow models that run in separate CI jobs, so that we can run those tests on CI in the future.
b297517
to
885f4cc
Compare
Hello @hawkw, I hope you're well. I wanted to kindly bring to your attention this PR. Could you please finish reviewing it when you have a moment. Thank you. |
Hi, I'm sorry, I must have missed this earlier! I'd love to get this PR merged soon and I'll give it another review shortly. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Okay, this looks good to me! I'm going to go ahead and merge it now. Thanks @tukan for the fix!
#[inline] | ||
fn check_has_reader(state: usize) -> bool { | ||
state & HAS_READER == HAS_READER | ||
} | ||
|
||
#[inline] | ||
fn set_has_reader(state: usize) -> usize { | ||
state | HAS_READER | ||
} | ||
|
||
#[inline] | ||
fn clear_has_reader(state: usize) -> usize { | ||
state & !HAS_READER | ||
} | ||
|
||
#[inline] | ||
fn wrapping_add(a: usize, b: usize) -> usize { | ||
(a + b) & MAX_CAPACITY | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There are now enough operations on state
that I wonder if it's worth turning it into a newtype...but, we can do that in a separate PR.
## v0.1.5 (2024-04-06) #### Features * **mpsc:** add `len`, `capacity`, and `remaining` methods to mpsc (#72) ([00213c1](00213c1), closes [#71](#71)) #### Bug Fixes * unused import with `alloc` enabled ([ac1eafc](ac1eafc)) * skip slots with active reading `Ref`s in `push_ref` (#81) ([a72a286](a72a286), closes [#83](#83), [#80](#80))
No description provided.