From 179b7c61ea6769b99f70c80a7a89cbb212423ec2 Mon Sep 17 00:00:00 2001 From: Vladimir Marko Date: Fri, 22 Mar 2019 13:38:57 +0000 Subject: ObjPtr<>-ify String allocations, fix stale refs. ObjPtr<>-ify String allocation functions and related code and remove some unnecessary calls to ObjPtr<>::Ptr(). Fix stale reference uses in reference_table_test and stub_test. Test: m test-art-host-gtest Test: testrunner.py --host --optimizing Bug: 31113334 Change-Id: I42927fb8b7240e5132188f73318b2ccb218748fd --- runtime/gc/heap_test.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'runtime/gc/heap_test.cc') diff --git a/runtime/gc/heap_test.cc b/runtime/gc/heap_test.cc index fa10150d46..5f4621e6f1 100644 --- a/runtime/gc/heap_test.cc +++ b/runtime/gc/heap_test.cc @@ -74,7 +74,8 @@ TEST_F(HeapTest, GarbageCollectClassLinkerInit) { Handle> array(hs2.NewHandle( mirror::ObjectArray::Alloc(soa.Self(), c.Get(), 2048))); for (size_t j = 0; j < 2048; ++j) { - mirror::String* string = mirror::String::AllocFromModifiedUtf8(soa.Self(), "hello, world!"); + ObjPtr string = + mirror::String::AllocFromModifiedUtf8(soa.Self(), "hello, world!"); // handle scope operator -> deferences the handle scope before running the method. array->Set(j, string); } -- cgit v1.2.3-59-g8ed1b