From d7e9bbf092b5a61048358fd54183526ef12284af Mon Sep 17 00:00:00 2001 From: Vladimir Marko Date: Thu, 28 Mar 2019 13:18:57 +0000 Subject: Clean up explicit conversions to ObjPtr<>. Add an ObjPtr<>::DownCast() overload that takes a plain pointer and remove unnecessary calls to MakeObjPtr(), usually preceding DownCast(). Move the MakeObjPtr() to common_art_test.h . Test: m test-art-host-gtest Test: testrunner.py --host --optimizing Bug: 31113334 Change-Id: I2a243b6d8f3b2e773396dfc53b659c5f7d9ea44a --- runtime/mirror/array-alloc-inl.h | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'runtime/mirror/array-alloc-inl.h') diff --git a/runtime/mirror/array-alloc-inl.h b/runtime/mirror/array-alloc-inl.h index 4250ff8c70..2ae4cab59c 100644 --- a/runtime/mirror/array-alloc-inl.h +++ b/runtime/mirror/array-alloc-inl.h @@ -142,16 +142,16 @@ inline ObjPtr Array::Alloc(Thread* self, ObjPtr result; if (!kFillUsable) { SetLengthVisitor visitor(component_count); - result = ObjPtr::DownCast(MakeObjPtr( - heap->AllocObjectWithAllocator(self, array_class, size, - allocator_type, visitor))); + result = ObjPtr::DownCast( + heap->AllocObjectWithAllocator( + self, array_class, size, allocator_type, visitor)); } else { SetLengthToUsableSizeVisitor visitor(component_count, DataOffset(1U << component_size_shift).SizeValue(), component_size_shift); - result = ObjPtr::DownCast(MakeObjPtr( - heap->AllocObjectWithAllocator(self, array_class, size, - allocator_type, visitor))); + result = ObjPtr::DownCast( + heap->AllocObjectWithAllocator( + self, array_class, size, allocator_type, visitor)); } if (kIsDebugBuild && result != nullptr && Runtime::Current()->IsStarted()) { array_class = result->GetClass(); // In case the array class moved. -- cgit v1.2.3-59-g8ed1b