summaryrefslogtreecommitdiff
path: root/src/lib/libc/string/wcscasecmp.c
diff options
context:
space:
mode:
authorotto <>2011-05-05 12:11:20 +0000
committerotto <>2011-05-05 12:11:20 +0000
commitad527ff4137ec2b21fca81a6af20dd16c170ea59 (patch)
treec677fe9275cd7c858ab19904f151d7ac9ca8097b /src/lib/libc/string/wcscasecmp.c
parent8153c96e134ad79b74adeb4f92f16ced96b28c78 (diff)
downloadopenbsd-ad527ff4137ec2b21fca81a6af20dd16c170ea59.tar.gz
openbsd-ad527ff4137ec2b21fca81a6af20dd16c170ea59.tar.bz2
openbsd-ad527ff4137ec2b21fca81a6af20dd16c170ea59.zip
Up until now, malloc scanned the bits of the chunk bitmap from
position zero, skipping a random number of free slots and then picking the next free one. This slowed things down, especially if the number of full slots increases. This changes the scannning to start at a random position in the bitmap and then taking the first available free slot, wrapping if the end of the bitmap is reached. Of course we'll still scan more if the bitmap becomes more full, but the extra iterations skipping free slots and then some full slots are avoided. The random number is derived from a global, which is incremented by a few random bits every time a chunk is needed (with a small optimization if only one free slot is left). Thanks to the testers!
Diffstat (limited to 'src/lib/libc/string/wcscasecmp.c')
0 files changed, 0 insertions, 0 deletions