mirror of
https://github.com/facebook/rocksdb.git
synced 2024-11-25 14:31:35 +00:00
dynamicbloom fix: don't offset address when it is already aligned
Summary: this causes overflow and asan failure Test Plan: make asan_check Reviewers: igor Reviewed By: igor CC: leveldb Differential Revision: https://reviews.facebook.net/D17301
This commit is contained in:
parent
43a593a6d9
commit
550cca7192
|
@ -39,7 +39,7 @@ DynamicBloom::DynamicBloom(uint32_t total_bits,
|
|||
sz += CACHE_LINE_SIZE - 1;
|
||||
}
|
||||
raw_ = new unsigned char[sz]();
|
||||
if (kBlocked) {
|
||||
if (kBlocked && (reinterpret_cast<uint64_t>(raw_) % CACHE_LINE_SIZE)) {
|
||||
data_ = raw_ + CACHE_LINE_SIZE -
|
||||
reinterpret_cast<uint64_t>(raw_) % CACHE_LINE_SIZE;
|
||||
} else {
|
||||
|
|
Loading…
Reference in a new issue