diff options
author | Jisi Liu <jisi.liu@gmail.com> | 2017-10-18 12:22:18 -0700 |
---|---|---|
committer | Jisi Liu <jisi.liu@gmail.com> | 2017-10-18 12:22:18 -0700 |
commit | 1a7a7fca804afa1cf67f8be5e71092898ba40334 (patch) | |
tree | 04b3da27c71c607510f34a12cf7856a1b94181ae /src/google/protobuf/lite_arena_unittest.cc | |
parent | c4f59dcc5c13debc572154c8f636b8a9361aacde (diff) |
Merge from google internal
Diffstat (limited to 'src/google/protobuf/lite_arena_unittest.cc')
-rw-r--r-- | src/google/protobuf/lite_arena_unittest.cc | 12 |
1 files changed, 6 insertions, 6 deletions
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<char>(arena_.get(), 1); } - std::vector<char> arena_block_; google::protobuf::scoped_ptr<Arena> arena_; }; |