Move Transaction logs to arena allocator.
And change some containers to reduce memory usage.
Also update `SafeMap` with some C++17 functions, namely all
`erase()` and `extract()` overloads and `insert()` overloads
taking a "node". The `extract()` and `insert()` overloads
are convenient to avoid allocation/dealocation when updating
the key of an entry.
Test: m test-art-host-gtest
Test: testrunner.py --host --optimizing
Bug: 181943478
Change-Id: I791d00598ac288b1f31c92daa63b5b3dcf6b41fa
diff --git a/runtime/transaction_test.cc b/runtime/transaction_test.cc
index 5c78505..88e3f4f 100644
--- a/runtime/transaction_test.cc
+++ b/runtime/transaction_test.cc
@@ -730,7 +730,9 @@
ASSERT_TRUE(heap->ObjectIsInBootImageSpace(array_iftable.Get()));
// Test non-strict transaction.
- Transaction transaction(/*strict=*/ false, /*root=*/ nullptr);
+ ArenaPool* arena_pool = Runtime::Current()->GetArenaPool();
+ Transaction transaction(
+ /*strict=*/ false, /*root=*/ nullptr, /*arena_stack=*/ nullptr, arena_pool);
// Static field in boot image.
EXPECT_TRUE(transaction.WriteConstraint(boolean_class.Get()));
EXPECT_FALSE(transaction.ReadConstraint(boolean_class.Get()));
@@ -754,7 +756,8 @@
EXPECT_FALSE(transaction.WriteValueConstraint(long_array.Get()));
// Test strict transaction.
- Transaction strict_transaction(/*strict=*/ true, /*root=*/ static_field_class.Get());
+ Transaction strict_transaction(
+ /*strict=*/ true, /*root=*/ static_field_class.Get(), /*arena_stack=*/ nullptr, arena_pool);
// Static field in boot image.
EXPECT_TRUE(strict_transaction.WriteConstraint(boolean_class.Get()));
EXPECT_TRUE(strict_transaction.ReadConstraint(boolean_class.Get()));