diff options
author | Adam Cozzette <acozzette@google.com> | 2016-06-29 15:23:27 -0700 |
---|---|---|
committer | Adam Cozzette <acozzette@google.com> | 2016-06-29 15:38:03 -0700 |
commit | d64a2d9941c36a7bc2a7959ea10ab8363192ac14 (patch) | |
tree | 52330d146ad63d3d70f3baade00d5d1fea8f5e0c /src/google/protobuf/arena.cc | |
parent | c18aa7795a2e02ef700ff8b039d94ecdcc33432f (diff) |
Integrated internal changes from Google
This includes all internal changes from around May 20 to now.
Diffstat (limited to 'src/google/protobuf/arena.cc')
-rwxr-xr-x | src/google/protobuf/arena.cc | 11 |
1 files changed, 2 insertions, 9 deletions
diff --git a/src/google/protobuf/arena.cc b/src/google/protobuf/arena.cc index 613e5897..78e20946 100755 --- a/src/google/protobuf/arena.cc +++ b/src/google/protobuf/arena.cc @@ -133,12 +133,7 @@ Arena::Block* Arena::NewBlock(void* me, Block* my_last_block, size_t n, Block* b = reinterpret_cast<Block*>(options_.block_alloc(size)); b->pos = kHeaderSize + n; b->size = size; - if (b->avail() == 0) { - // Do not attempt to reuse this block. - b->owner = NULL; - } else { - b->owner = me; - } + b->owner = me; #ifdef ADDRESS_SANITIZER // Poison the rest of the block for ASAN. It was unpoisoned by the underlying // malloc but it's not yet usable until we return it as part of an allocation. @@ -223,9 +218,7 @@ void* Arena::SlowAlloc(size_t n) { } b = NewBlock(me, b, n, options_.start_block_size, options_.max_block_size); AddBlock(b); - if (b->owner == me) { // If this block can be reused (see NewBlock()). - SetThreadCacheBlock(b); - } + SetThreadCacheBlock(b); return reinterpret_cast<char*>(b) + kHeaderSize; } |