-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
std.hash_map: adding a rehash() method #19923
Conversation
82a8478
to
24a1c54
Compare
@linusg thanks! fixed those 3 comments, and rebased on master again. |
ad2ebd0
to
51e0b86
Compare
I'll just keep it rebased on master until @andrewrk tells me he doesn't like this PR. |
To mirror my comment in #17851: We can remove the user burden of calling rehash manually by requiring any adapter context to have an additional |
After this is merged, I'd be happy to fix #7494 (if it turns out to still be a problem). |
Note: this resurrects the recently closed #17890.
This allows a highly fragmented HashMap to have tombstones removed as the values are all rehashed.
It would be nice to make this
rehash()
automatically, but that currently presents a challenge where it doesn't work with adapted contexts since the keys are not preserved in the map for re-hashing and the hash value is not stored currently, and the non-adapted contexts require a bit of additional book-keeping to check before calling rehash().This is a partial fix for #17851, but requires the user to call
rehash()
periodically to get the benefit.