DoxigAlpha

rehash

Rehash the map, in-place.

Over time, due to the current tombstone-based implementation, a HashMap could become fragmented due to the buildup of tombstone entries that causes a performance degradation due to excessive probing. The kind of pattern that might cause this is a long-lived HashMap with repeated inserts and deletes.

After this function is called, there will be no tombstones in the HashMap, each of the entries is rehashed and any existing key/value pointers into the HashMap are invalidated.

Function parameters

Parameters

#
self:*Self

Type definitions in this namespace

Types

#

Functions in this namespace

Functions

#
StringHashMap
Builtin hashmap for strings as keys.
StringHashMapUnmanaged
Key memory is managed by the caller.
HashMap
General purpose hash table.
HashMapUnmanaged
A HashMap based on open addressing and linear probing.

= 80

Values

#

Source

Implementation

#
pub fn rehash(self: *Self) void {
    self.unmanaged.rehash(self.ctx);
}