diff options
author | Charles Blake <cblake@csail.mit.edu> | 2015-02-12 05:22:04 -0500 |
---|---|---|
committer | Charles Blake <cblake@csail.mit.edu> | 2015-02-12 05:22:04 -0500 |
commit | 5fbcf93860e68d7ddde4b01aa4b7222a7fcaaabc (patch) | |
tree | 590496b603e53e868904eb0321806bd651e465e6 /lib/impure/osinfo_win.nim | |
parent | 2cc5bc0db34b2debe3377b147f776e8ea39f1045 (diff) | |
download | Nim-5fbcf93860e68d7ddde4b01aa4b7222a7fcaaabc.tar.gz |
Add hcode,rightSize,rawGetKnownHC. Fix inf loop.
Make similar changes to those made in sets.nim, including hcode, rightSize rawGet/rawGetKnownHC result protocol, nextTry probe sequence to be the cache friendlier h=h+1 which in turn allows supporting changing deletion to fix the infinite loop bug with local rehashing which in turn has desirable properties of graceful table aging when deletes do happen and also making insert-only usage patterns no longer pay any time/space cost to check deleted status. Unlike collections.sets, this module has add() for duplicate key inserts and a 3rd type of table, CountTable. The first wrinkle is handled by introducing a rawGetDeep for unconditionally adding entries along collision chains. This point of CountTable seems to be space efficiency at 2 items per slot. These changes retain that by keeping the val==0 => EMPTY rule and not caching hash codes. putImpl is expanded in-place for CountTable since the new putImpl() is too different. { Depending on table size relative to caches & key expense, regular Table[A,B] may become faster than CountTable, especially if the basic count update could be something like inc(mGetOrPut(t, key, 0)). } Unit tests pass, but in this module those are much more of just a demo than probing for bugs. Should exercise/test this a little more before merging.
Diffstat (limited to 'lib/impure/osinfo_win.nim')
0 files changed, 0 insertions, 0 deletions