Fix the compile warning

Summary: clang is a bit confused, see here: https://travis-ci.org/facebook/rocksdb/jobs/82214750

Test Plan: travis CI

Reviewers: sdong

Subscribers: dhruba, leveldb

Differential Revision: https://reviews.facebook.net/D47601
main
Igor Canadi 9 years ago
parent 174e2be5f0
commit 7ee445dd68
  1. 5
      util/arena.cc

@ -82,7 +82,7 @@ char* Arena::AllocateFallback(size_t bytes, bool aligned) {
} }
// We waste the remaining space in the current block. // We waste the remaining space in the current block.
size_t size; size_t size = 0;
char* block_head = nullptr; char* block_head = nullptr;
#ifdef MAP_HUGETLB #ifdef MAP_HUGETLB
if (hugetlb_size_) { if (hugetlb_size_) {
@ -90,7 +90,8 @@ char* Arena::AllocateFallback(size_t bytes, bool aligned) {
block_head = AllocateFromHugePage(size); block_head = AllocateFromHugePage(size);
} }
#endif #endif
if (!block_head) { if (size == 0) {
assert(block_head == nullptr);
size = kBlockSize; size = kBlockSize;
block_head = AllocateNewBlock(size); block_head = AllocateNewBlock(size);
} }

Loading…
Cancel
Save