Merge pull request #727 from AustinSchuh/arena_bounds_fix

Handled blocks being too small in arena.cc
This commit is contained in:
Feng Xiao 2015-09-24 17:41:45 -07:00
commit 0e5686a707

View File

@ -61,6 +61,9 @@ void Arena::Init() {
cleanup_list_ = 0;
if (options_.initial_block != NULL && options_.initial_block_size > 0) {
GOOGLE_CHECK_GE(options_.initial_block_size, sizeof(Block))
<< ": Initial block size too small for header.";
// Add first unowned block to list.
Block* first_block = reinterpret_cast<Block*>(options_.initial_block);
first_block->size = options_.initial_block_size;