Commit Graph

4 Commits

Author SHA1 Message Date
Behdad Esfahbod 333173103b Fix sign of shift operators
This one:

  map->mask = (1 << (next_bit + bits_needed)) - (1 << next_bit);

before the fix, the shift was done as an int, causing overflow
if it ever got to 1 << 31.  Sprinkle 'u's around.

Fixes https://bugs.chromium.org/p/chromium/issues/detail?id=634805
2016-08-08 17:28:14 -07:00
Behdad Esfahbod 46617a4213 Fix cache implementation 2012-06-09 01:43:20 -04:00
Behdad Esfahbod e4b6d503c5 Don't use atomic ops in hb_cache_t
We don't care about linearizability, so unprotected int read/write
are enough, no need for expensive memory barriers.  It's a cache,
that's all.
2012-05-27 10:11:13 -04:00
Behdad Esfahbod 20fdb0f41d Add a lock-free cache type for int->int functions
To be used for cmap and advance caching if desired.
2012-05-17 22:04:45 -04:00