|
|
@ -1232,11 +1232,11 @@ TEST(ArenaTest, ArenaHooksSanity) { |
|
|
|
EXPECT_EQ(1, ArenaHooksTestUtil::num_init); |
|
|
|
EXPECT_EQ(1, ArenaHooksTestUtil::num_init); |
|
|
|
EXPECT_EQ(0, ArenaHooksTestUtil::num_allocations); |
|
|
|
EXPECT_EQ(0, ArenaHooksTestUtil::num_allocations); |
|
|
|
::google::protobuf::Arena::Create<uint64>(&arena); |
|
|
|
::google::protobuf::Arena::Create<uint64>(&arena); |
|
|
|
#ifdef _WIN32 |
|
|
|
if (::google::protobuf::internal::has_trivial_destructor<uint64>::value) { |
|
|
|
EXPECT_EQ(2, ArenaHooksTestUtil::num_allocations); |
|
|
|
EXPECT_EQ(1, ArenaHooksTestUtil::num_allocations); |
|
|
|
#else |
|
|
|
} else { |
|
|
|
EXPECT_EQ(1, ArenaHooksTestUtil::num_allocations); |
|
|
|
EXPECT_EQ(2, ArenaHooksTestUtil::num_allocations); |
|
|
|
#endif |
|
|
|
} |
|
|
|
arena.Reset(); |
|
|
|
arena.Reset(); |
|
|
|
arena.Reset(); |
|
|
|
arena.Reset(); |
|
|
|
EXPECT_EQ(2, ArenaHooksTestUtil::num_reset); |
|
|
|
EXPECT_EQ(2, ArenaHooksTestUtil::num_reset); |
|
|
|