hawkw / sharded-slab

a lock-free concurrent slab (experimental)
MIT License
269 stars 17 forks source link

consider adding a `Guard` method to clear/remove the entry #37

Open hawkw opened 4 years ago

hawkw commented 4 years ago

Since a guard has a reference to the slab and knows the index of the entry, it should be possible to add a method to mark the entry to be cleared. This would drop the guard, since the entry may no longer be accessible. This could be a little more ergonomic than having to call the clear/remove method on the Slab/Pool in some cases.

eggyal commented 9 months ago

Short of adding such a method, could the guards at least expose a getter method for the slab/pool (currently I'm wrapping it up together with a reference thereto in a newtype, which is just needlessly wasteful)?