Closed loyd closed 1 year ago
@hawkw, can you check this PR, please?
@hawkw, I've added two integrational tests (I consider them more reliable for preventing regression than the unit ones) that cover 3/5 changed places. I couldn't write a test in half an hour to reveal bugs in fn release2()
and fn release()
methods (both in integrational and loom tests), so let's merge these ones, it's better than nothing.
@loyd Okay, that sounds good to me. Thanks for taking the time to add tests at all!
@hawkw, can you release a new release?
@hawkw, can you release a new release?
@loyd https://crates.io/crates/sharded-slab/0.1.5 :tada: --- sorry to keep you waiting!
Hi, I used the following config and found the incorrect calculations of the generation and reference counter. After debugging, I discovered that sometimes
Generation::pack
is used instead ofLifecycleGen::pack
, which can be fixed by this PR.My config:
The bug cannot be reproduced with the default config, because
Generation
andLifecycleGen
have the samePack::SHIFT
.It would be nice to remove
impl Pack for Generation
in favor of differentimpl Pack for KeyGen
andimpl Pack for LifecycleGen
, but I decided not to do any extra refactoring, which you may not accept.If the patch is ok for you, I can add a test to prevent regression in the future.