summary refs log tree commit diff stats
path: root/lib/impure/osinfo_win.nim
diff options
context:
space:
mode:
authorCharles Blake <cblake@csail.mit.edu>2015-02-12 05:22:04 -0500
committerCharles Blake <cblake@csail.mit.edu>2015-02-12 05:22:04 -0500
commit5fbcf93860e68d7ddde4b01aa4b7222a7fcaaabc (patch)
tree590496b603e53e868904eb0321806bd651e465e6 /lib/impure/osinfo_win.nim
parent2cc5bc0db34b2debe3377b147f776e8ea39f1045 (diff)
downloadNim-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