diff options
author | Feng Xiao <xfxyjwf@gmail.com> | 2014-11-14 11:50:31 -0800 |
---|---|---|
committer | Feng Xiao <xfxyjwf@gmail.com> | 2014-11-14 11:50:31 -0800 |
commit | f157a5651c79a7a36e242af216a5d5b383ba8af2 (patch) | |
tree | 368bb0ca0e89ab7514302e4df00435a4ef461a28 /src/google/protobuf/arena.cc | |
parent | faf581d20866ad5e586b3e515f6c547d2dcec2c1 (diff) | |
download | protobuf-f157a5651c79a7a36e242af216a5d5b383ba8af2.tar.gz protobuf-f157a5651c79a7a36e242af216a5d5b383ba8af2.tar.bz2 protobuf-f157a5651c79a7a36e242af216a5d5b383ba8af2.zip |
Down-integrate from internal code base (C++ maps support).
Diffstat (limited to 'src/google/protobuf/arena.cc')
-rw-r--r-- | src/google/protobuf/arena.cc | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/google/protobuf/arena.cc b/src/google/protobuf/arena.cc index 59863986..17b095aa 100644 --- a/src/google/protobuf/arena.cc +++ b/src/google/protobuf/arena.cc @@ -138,7 +138,7 @@ void* Arena::AllocateAligned(size_t n) { // for this thread. if (!owns_first_block_ && b->next == NULL) { MutexLock l(&blocks_lock_); - if (b->owner == &b->owner) { + if (b->owner == &b->owner && b->avail() >= n) { b->owner = me; SetThreadCacheBlock(b); return AllocFromBlock(b, n); |