uint64 has non-trivial destructor on 32-bit windows. This cause arena
allocator to allocate memory twice for uint64.
This commit is contained in:
parent
cdd5b3b84b
commit
3a5455b34b
1 changed files with 5 additions and 5 deletions
|
@ -1232,11 +1232,11 @@ TEST(ArenaTest, ArenaHooksSanity) {
|
|||
EXPECT_EQ(1, ArenaHooksTestUtil::num_init);
|
||||
EXPECT_EQ(0, ArenaHooksTestUtil::num_allocations);
|
||||
::google::protobuf::Arena::Create<uint64>(&arena);
|
||||
#ifdef _WIN32
|
||||
EXPECT_EQ(2, ArenaHooksTestUtil::num_allocations);
|
||||
#else
|
||||
EXPECT_EQ(1, ArenaHooksTestUtil::num_allocations);
|
||||
#endif
|
||||
if (::google::protobuf::internal::has_trivial_destructor<uint64>::value) {
|
||||
EXPECT_EQ(1, ArenaHooksTestUtil::num_allocations);
|
||||
} else {
|
||||
EXPECT_EQ(2, ArenaHooksTestUtil::num_allocations);
|
||||
}
|
||||
arena.Reset();
|
||||
arena.Reset();
|
||||
EXPECT_EQ(2, ArenaHooksTestUtil::num_reset);
|
||||
|
|
Loading…
Add table
Reference in a new issue