-
Notifications
You must be signed in to change notification settings - Fork 161
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Improve memory reservation for
insert_entry
In `core::RefMut::insert_unique`, used by `insert_entry` and others, we were calling `reserve_entries` *before* the table insert, which defeats the goal of matching capacities. We can't directly call that after table insert though, because we'll be holding an `OccupiedEntry` that prevents looking at the table itself. Instead, this code path now uses a more typical doubling growth on the entries `Vec` itself, but still enhanced by considering `MAX_ENTRIES_CAPACITY` as well.
- Loading branch information
Showing
1 changed file
with
22 additions
and
18 deletions.
There are no files selected for viewing
This file contains 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