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
This commit is contained in:
xiusir 2017-02-28 10:29:44 -08:00 committed by Facebook Github Bot
parent 08864df212
commit 90d8355075

View File

@ -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);
}
}