diff options
author | Sverker Eriksson <sverker@erlang.org> | 2023-03-31 22:53:00 +0200 |
---|---|---|
committer | Sverker Eriksson <sverker@erlang.org> | 2023-04-26 18:27:56 +0200 |
commit | e1044e4213f7f793c5ff2380081766954517d6f9 (patch) | |
tree | b9edf1c0eb5142f18b68894f0ccd61fcaad07eda /lib/dialyzer/test | |
parent | 2912a1899deaaa032f128bda11b8277f59b1930e (diff) | |
download | erlang-e1044e4213f7f793c5ff2380081766954517d6f9.tar.gz |
erts: Implement hashmap collision nodes
Restrict depth of hashmap tree to 8 levels.
Instead of rehashing with salt, give up and put colliding keys
in "collision nodes" at the bottom of the tree.
Collision nodes are normal tuples of arity 2 or larger.
The elements of collision nodes are key-value cons cells
like the other nodes, but they are sorted in map-key order.
We do linear search in them, but that's ok as they should
be small and rare in practice.
Why?
We had some scary encounter with forever colliding term pairs
in make_internal_hash(). Even though that has been fixed
we will sleep better at night knowing the hashmaps may
not recurse forever draining all memory of the machine.
Diffstat (limited to 'lib/dialyzer/test')
0 files changed, 0 insertions, 0 deletions