Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #25 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 3 3
Lines 871 901 +30
=========================================
+ Hits 871 901 +30 ☔ View full report in Codecov by Sentry. |
There was a problem hiding this comment.
Pull request overview
This PR optimizes the entry cleanup mechanism in LockMap by introducing a StateFlags struct that packs both the reference count and a "has value" flag into a single AtomicU32. This allows the cleanup logic to check both conditions atomically without needing to inspect the actual value under lock.
Key changes:
- Introduced
StateFlagsstruct with bit-packed reference count (31 bits) and has-value flag (1 bit) - Replaced
State<V>.refcntwithState<V>.flagsthroughout the codebase - Updated entry drop implementations to set the value flag before attempting cleanup
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 1 out of 1 changed files in this pull request and generated 2 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This PR optimizes the entry cleanup mechanism in
LockMapby introducing aStateFlagsstruct that packs both the reference count and a "has value" flag into a singleAtomicU32. This allows the cleanup logic to check both conditions atomically without needing to inspect the actual value under lock.