rust-lang / rust-lang/hashbrown

allocator-api2 default-feature?

Open
#484 4 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Rust
Stars
3k
Forks
358
Avg merge
11h 57m
Merged PRs (30d)
2

Description

Hi,

I'm updating some codebase and noticed the changes wrt allocator-api2.

https://github.com/rust-lang/hashbrown/pull/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.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reading the referenced hashbrown pull request #417 and the crate's default-feature configuration for allocator-api2 and ahash. Determine whether allocator-api2 should remain enabled by default and whether disabling default features while enabling ahash is the supported configuration; done means the project has a clear decision and documented feature guidance.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
data
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.