Skip to content

Commit

Permalink
Make empty bucket be a per-map object. Needed to fix allocation problems
Browse files Browse the repository at this point in the history
  • Loading branch information
Sonicadvance1 committed Aug 18, 2024
1 parent 188c455 commit d5683d9
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions include/tsl/robin_hash.h
Original file line number Diff line number Diff line change
Expand Up @@ -1591,8 +1591,6 @@ class robin_hash : private Hash, private KeyEqual, private GrowthPolicy {
* last_bucket() == true.
*/
bucket_entry* static_empty_bucket_ptr() noexcept {
static bucket_entry empty_bucket(true);
tsl_rh_assert(empty_bucket.empty());
return &empty_bucket;
}

Expand All @@ -1609,6 +1607,7 @@ class robin_hash : private Hash, private KeyEqual, private GrowthPolicy {
* Allocator manually.
*/
bucket_entry* m_buckets;
bucket_entry empty_bucket{true};

/**
* Used a lot in find, avoid the call to m_buckets_data.size() which is a bit
Expand Down

0 comments on commit d5683d9

Please sign in to comment.