-
Notifications
You must be signed in to change notification settings - Fork 28
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
POC: A dynamic memory allocator for BTreeMap #105
Closed
Closed
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ielashi
force-pushed
the
ielashi/tlsf
branch
2 times, most recently
from
July 19, 2023 11:13
5f17e66
to
b900c0c
Compare
ielashi
changed the title
WIP: A dynamic memory allocator for BTreeMap
POC: A dynamic memory allocator for BTreeMap
Jul 19, 2023
Closing this PR as we ended up using a different approach for BTreeMap that relies on fixed-size pages. The reason we opted for the latter solution rather than a dynamic memory allocator is that it's safer. A dynamic memory allocator may be more efficient, but depending on the usage pattern the amount of external fragmentation is unbounded. We many potentially revisit this idea in the future though. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR introduces a dynamic memory allocator implementation, which will be used in the BTreeMap to allow for unbounded types. The allocator uses a two-level segregated free list to manage allocations, which is described in this paper by Masmano et al.
The implementation is functionally complete, but there are a few missing pieces:
tlsf.rs
tlsf/blocks.rs
tlfs/free_lists.rs
This PR will be broken down into smaller bite-sized PRs.
While this allocator will initially only be used by BTreeMap, it is designed to be general-purpose and can be used by other structures in the future.