Fix the wrong address for PREFETCH in DynamicBloom::Prefetch

Summary:
- Change data_[b] to data_[b / 8] in DynamicBloom::Prefetch, as b means the b-th bit in data_ and data_[b / 8] is the proper byte in data_.
Closes https://github.com/facebook/rocksdb/pull/1935

Differential Revision: D4628696

Pulled By: siying

fbshipit-source-id: bc5a0c6
main
xiusir 7 years ago committed by Facebook Github Bot
parent 08864df212
commit 90d8355075
  1. 2
      util/dynamic_bloom.h

@ -128,7 +128,7 @@ inline bool DynamicBloom::MayContain(const Slice& key) const {
inline void DynamicBloom::Prefetch(uint32_t h) {
if (kNumBlocks != 0) {
uint32_t b = ((h >> 11 | (h << 21)) % kNumBlocks) * (CACHE_LINE_SIZE * 8);
PREFETCH(&(data_[b]), 0, 3);
PREFETCH(&(data_[b / 8]), 0, 3);
}
}

Loading…
Cancel
Save