Fix the test failure

Summary: AllocateFromHugePage() can return nullptr, and then we need to try to allocate the block with AllocateNewBlock()

Test Plan: arena_test

Reviewers: sdong

Reviewed By: sdong

Subscribers: dhruba, leveldb

Differential Revision: https://reviews.facebook.net/D47607
main
Igor Canadi 9 years ago
parent 63e0f86797
commit dac3f22b77
  1. 3
      util/arena.cc

@ -90,8 +90,7 @@ char* Arena::AllocateFallback(size_t bytes, bool aligned) {
block_head = AllocateFromHugePage(size);
}
#endif
if (size == 0) {
assert(block_head == nullptr);
if (!block_head) {
size = kBlockSize;
block_head = AllocateNewBlock(size);
}

Loading…
Cancel
Save