Github Hide allocator details and default to Global by cuviper · Pull Request #2...
source link: https://github.com/rust-lang/hashbrown/pull/227
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
Member
cuviper commented 12 days ago
This is a breaking change!
We no longer re-export the unstable allocator items from the standard library, nor the stable shims approximating the same. The choice was predicated on the "nightly" feature, but crates that did not set that feature could be forced into it by others in the dependency tree, and then fail for lack of #![feature(allocator_api)]
when referencing these items. All types have been audited to have a default A=Global
to make sure the type doesn't need to be named for stable users. Fixes #226.
Many of the parallel iterators don't need the S
hasher or A
allocator at all if they convert to a tighter inner type upon construction. This has been cleaned up, and those that do still need A
now default to A=Global
.
RawTable::with_capacity
and try_with_capacity
have moved back to being methods for Global
only. New with_capacity_in
and try_with_capacity_in
methods allow custom allocators, with the alloc
parameter last to match the similar methods on HashMap
and HashSet
.
Recommend
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK