summaryrefslogtreecommitdiffstats
path: root/lib/libutil
diff options
context:
space:
mode:
authorderaadt <deraadt@openbsd.org>1996-06-18 10:07:41 +0000
committerderaadt <deraadt@openbsd.org>1996-06-18 10:07:41 +0000
commit64d71990389d0c49a0f7b6d7ebeca8978261a32c (patch)
tree4f3dc2367b157c19d82c536a4f311dcc8a1dc28b /lib/libutil
parentupdate id (diff)
downloadwireguard-openbsd-64d71990389d0c49a0f7b6d7ebeca8978261a32c.tar.xz
wireguard-openbsd-64d71990389d0c49a0f7b6d7ebeca8978261a32c.zip
use p->hashfraction when doing non-time-critical calculations, rather than
using HASHFRACTION directly. in time-critical calculations, if HASHFRACTION is a power of two, check that p->hashfraction == HASHFRACTION and if so do the calculation with the compiled-in value so that the compiler can optimize out (potentially) expensive divisions. if p->hashfraction != HASHFRACTION, actually do the division. This has the result that on machines with slow division, the division can be optimized out of the common case, but that if HASHFRACTION changes from the compiled-in value (for whatever reason), profiling will still work. Changes suggested by Chris Torek.
Diffstat (limited to 'lib/libutil')
0 files changed, 0 insertions, 0 deletions