diff options
author | Theo de Raadt <deraadt@cvs.openbsd.org> | 2008-02-29 12:21:13 +0000 |
---|---|---|
committer | Theo de Raadt <deraadt@cvs.openbsd.org> | 2008-02-29 12:21:13 +0000 |
commit | d58f53ca64cff5b3636359292e554da731dc6fa5 (patch) | |
tree | bb30607fe392d7f945f1ab6c7ba5210889de18fd /sys/kern/kern_tc.c | |
parent | 6827f1138212e02ae934a71fb96e4cab3ee266e2 (diff) |
replacement algorithm. initialize a 64K-short buffer using Durstenfeld
shuffle. Upon allocation, swap-permute the new value to a random slot in
the 0..32K-1 th entry of the buffer as we move forward, ensuring randomness
but also satisfying the non-repeating property we need. Inspired by Dillon's
implementation for ip id.
We believe this is easier to read though, initializes with less bias and wins
speed tests.
Thanks a lot to mcbride and djm for doing a bunch of statistical and speed
analysis, and comments from nordin
ok jakob djm mcbride
Diffstat (limited to 'sys/kern/kern_tc.c')
0 files changed, 0 insertions, 0 deletions