Merlin_utils.Stamped_hashtable
SourceAn instance of a stamped hashtable
The changelog
datastructure logs stamped bindings added to tables. By separating the log from the table, it is possible to efficiently remove stamped bindings spread accross multiple tables.
create changelog n
creates a new table with an initial size of n
(see Hashtbl.create
) that logs its changes to changelog
.
Add a binding, like Hashtbl.add
, with an optional stamp
. Unlike Hashtbl.add
, having multiple bindings with the same key is undefined. (It's ok, this feature is not used by the caches!)