This factors out some common code and generally simplifies and unifies the behavior. With additional tests and fuzzer checks.
The second commit addresses the use of as_unique_address(), which is used in ObjectCache as a cheap hash map (index into a Vec). However, with the SmallAtom feature, NodePtr indices is no longer dense, and it no longer works to use a Vec instead of a HashMap. It allocates too much memory if you create an atom with value 0x3ffffff.
This commit is included in this PR since the increased fidelity of matching atoms to SmallAtom pushed the fuzzer over the limit and started failing with out-of-memory.
This factors out some common code and generally simplifies and unifies the behavior. With additional tests and fuzzer checks.
The second commit addresses the use of
as_unique_address()
, which is used inObjectCache
as a cheap hash map (index into aVec
). However, with theSmallAtom
feature,NodePtr
indices is no longer dense, and it no longer works to use aVec
instead of aHashMap
. It allocates too much memory if you create an atom with value0x3ffffff
.This commit is included in this PR since the increased fidelity of matching atoms to
SmallAtom
pushed the fuzzer over the limit and started failing with out-of-memory.