Use deterministic randomness fuzzing the pooling allocator (#5247)
This commit updates the index allocation performed in the pooling allocator with a few refactorings: * With `cfg(fuzzing)` a deterministic rng is now used to improve reproducibility of fuzz test cases. * The `Mutex` was pushed inside of `IndexAllocator`, renamed from `PoolingAllocationState`. * Randomness is now always done through a `SmallRng` stored in the `IndexAllocator` instead of using `thread_rng`. * The `is_empty` method has been removed in favor of an `Option`-based return on `alloc`. This refactoring is additionally intended to encapsulate more implementation details of `IndexAllocator` to more easily allow for alternate implementations in the future such as lock-free approaches (possibly).
This commit is contained in:
@@ -21,7 +21,7 @@ memoffset = "0.6.0"
|
||||
indexmap = "1.0.2"
|
||||
thiserror = "1.0.4"
|
||||
cfg-if = "1.0"
|
||||
rand = "0.8.3"
|
||||
rand = { version = "0.8.3", features = ['small_rng'] }
|
||||
anyhow = { workspace = true }
|
||||
memfd = "0.6.1"
|
||||
paste = "1.0.3"
|
||||
|
||||
Reference in New Issue
Block a user