7.6 Hash table extensions
hash-table-rehash-threshold Function
Syntax:hash-table-rehash-size
hash-table
Syntax:hash-table-rehash-threshold
hash-table
Syntax:hash-table-size
hash-table
Syntax:hash-table-test
hash-table
make-hash-table
:hash-table-rehash-size
accesses the:rehash-size
component.hash-table-rehash-threshold
accesses the:rehash-threshold
component.hash-table-size
accesses the:size
component.hash-table-test
accesses the:test
component.setf
with the functionshash-table-rehash-size
,hash-table-rehash-threshold
, andhash-table-test
to update the corresponding hash table component; you cannot update the:size
component in this way.
rehash
;make-hash-table
(in CLtL2)
Syntax:rehash
hash-table&optional
new-option
rehash
either changes the size of the specified hash table or redistributes the keys as evenly as possible over the range of index values. This redistribution of keys, or rehashing, can improve the performance of hashing functions by reducing the number of probes that are necessary to find an element in the table.
nil
, the hash table is rehashed, but its size is not changed.t
, the hash table size is increased by the amount specified by the hash table's:rehash-size
keyword option.:size
keyword option.:size
parameter specifies a lower bound on the size of the hash table that is no larger than one-half the size of the Common Lisp constantarray-total-size-limit
, though this bound is unrealistically high.rehash
is called internally with new-option set tot
to increase the size of the table.
eq
oreql
might need to be rehashed after any relocating garbage collection, including any ephemeral scavengings. Rehashing is advised because the addresses of the keys entered in the table can change after a relocation. This kind of rehashing is not necessary for any table whose keys are all either symbols, fixnums, or characters.
make-hash-table
(in CLtL2)
Generated with Harlequin WebMaker