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
This commit is contained in:
Igor Canadi 2015-09-25 13:55:11 -07:00
parent 63e0f86797
commit dac3f22b77

View file

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