From 1a7a7fca804afa1cf67f8be5e71092898ba40334 Mon Sep 17 00:00:00 2001 From: Jisi Liu Date: Wed, 18 Oct 2017 12:22:18 -0700 Subject: Merge from google internal --- src/google/protobuf/lite_arena_unittest.cc | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'src/google/protobuf/lite_arena_unittest.cc') diff --git a/src/google/protobuf/lite_arena_unittest.cc b/src/google/protobuf/lite_arena_unittest.cc index 1f4c2540..dadaffb6 100644 --- a/src/google/protobuf/lite_arena_unittest.cc +++ b/src/google/protobuf/lite_arena_unittest.cc @@ -39,16 +39,16 @@ namespace { class LiteArenaTest : public testing::Test { protected: - // We create an Arena with a large initial block of memory, so that tests can - // verify that no new allocations are made. - LiteArenaTest() : arena_block_(128 * 1024) { + LiteArenaTest() { ArenaOptions options; - options.initial_block = &arena_block_[0]; - options.initial_block_size = arena_block_.size(); + options.start_block_size = 128 * 1024; + options.max_block_size = 128 * 1024; arena_.reset(new Arena(options)); + // Trigger the allocation of the first arena block, so that further use of + // the arena will not require any heap allocations. + google::protobuf::Arena::CreateArray(arena_.get(), 1); } - std::vector arena_block_; google::protobuf::scoped_ptr arena_; }; -- cgit v1.2.3