Add allocator API support to basic Slotmap type#152
Open
TooManyLimits wants to merge 6 commits into
Open
Conversation
The testing system really doesn't like the setup I used for the feature-dependent alloc types
This file contains hidden or 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
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.
Allows the basic
SlotMaptype to take an extraA: Allocatorgeneric which will be used for allocation. There are 3 modes depending on the features selected:nightlyfeature: Uses the nightly allocator API Allocator traitallocator-api2feature: Uses the allocator-api2 crate to implement the allocator api in stable Rust, without needing nightlyCurrently the impl only targets the
SlotMaptype defined inbasic.rs, but it could be implemented for the other maps similarly.Please let me know if you have questions about my impl or suggestions for things that should change. Thanks!
Edit: I heard that apparently there's movement happening recently towards stabilizing allocator API. If that happens, this PR would be essentially useless, since most of its functionality is in switching allocator impls between feature sets. So if you believe it'll be stable soon, then it would be better to ignore/close this PR, and use the API in a normal, sane way without the weird config/modules/newtype hacks.