alexcrichton opened PR #5247 from deterministic-fuzzing
to main
:
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 ofIndexAllocator
, renamed fromPoolingAllocationState
.- Randomness is now always done through a
SmallRng
stored in theIndexAllocator
instead of usingthread_rng
.- The
is_empty
method has been removed in favor of anOption
-based return onalloc
.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).<!--
Please ensure that the following steps are all taken care of before submitting
the PR.
[ ] This has been discussed in issue #..., or if not, please tell us why
here.[ ] A short description of what this does, why it is needed; if the
description becomes long, the matter should probably be discussed in an issue
first.[ ] This PR contains test cases, if meaningful.
- [ ] A reviewer from the core maintainer team has been assigned for this PR.
If you don't know who could review this, please indicate so. The list of
suggested reviewers on the right can help you.Please ensure all communication adheres to the code of conduct.
-->
fitzgen submitted PR review.
alexcrichton has enabled auto merge for PR #5247.
alexcrichton merged PR #5247.
Last updated: Dec 23 2024 at 12:05 UTC