aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/google/protobuf/lite_arena_unittest.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/google/protobuf/lite_arena_unittest.cc')
-rw-r--r--src/google/protobuf/lite_arena_unittest.cc12
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_;
};