You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I want to lead with the fact that I am not an advanced Rust developer, so my question may be (probably is) stupid.
From my (limited) experience, I'm not sure I understand why this feature is on by default.
I would expect a custom allocator to be opt-in, specially since it forms the foundation of all the types. It feels weird hashbrown by default uses a different allocator (albeit a c/p of the official one) than the other pieces of code that I have.
I am concerned about minor updates that could change how the allocators work as they might go out of sync.
So to alleviate that, I turned off all default features and only enabled ahash.
Next to the question above, as to why it is default, I am wondering if the turning off default features and just adding ahash is the right way to address the concern?
Thanks.
The text was updated successfully, but these errors were encountered:
I don't understand the concern. If no allocator is specified then it will always default to the global allocator (specified with #[global_allocator]. The Global allocator in allocator-api2 forwards to this.
The only reason this is an optional feature is that it needs to be disabled when hashbrown is built as part of the standard library.
Hi,
I'm updating some codebase and noticed the changes wrt
allocator-api2
.#417
I want to lead with the fact that I am not an advanced Rust developer, so my question may be (probably is) stupid.
From my (limited) experience, I'm not sure I understand why this feature is on by default.
I would expect a custom allocator to be opt-in, specially since it forms the foundation of all the types. It feels weird hashbrown by default uses a different allocator (albeit a c/p of the official one) than the other pieces of code that I have.
I am concerned about minor updates that could change how the allocators work as they might go out of sync.
So to alleviate that, I turned off all default features and only enabled
ahash
.Next to the question above, as to why it is default, I am wondering if the turning off default features and just adding
ahash
is the right way to address the concern?Thanks.
The text was updated successfully, but these errors were encountered: