Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add a high-water-mark indicator to hash-table kv vectors
The high water mark allows many operations to be O(high-water-mark) which is usually the same as O(count), i.e. less than O(size). In particular, avoid scanning beyond the mark in MAPHASH, CLRHASH, rehash, and the garbage collector's scavenging routines. Furthermore, avoid linking all cells into a freelist initially. Anything above the HWM is implicitly a list such that the next cell in the list is always one beyond the high water mark. Only the cells below the high-water mark need to be placed in a freelist, which never happens in the absence of REMHASH. Skip explicitly initializing the hash vector. Always store a hash if applicable when a key is stored. Simiarly don't 0-init the NEXT vector. Fix a suboptimality in immobile space core relocation on startup- it marked a table as needing rehash if a value moved. In all probability, most tables get so marked during save-lisp-and-die, but the bug could have been evident if keys were non-pointers and values were pointers. Minor touch-ups: rename hash-table-table to hash-table-pairs and hash-table-number-entries to hash-table-%count.
- Loading branch information
Showing
11 changed files
with
319 additions
and
272 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.