summaryrefslogtreecommitdiff
path: root/runtime/mirror/array-alloc-inl.h
diff options
context:
space:
mode:
author Pechetty Sravani (xWF) <pechetty@google.com> 2024-09-03 05:20:26 +0000
committer Greg Kaiser <gkaiser@google.com> 2024-09-03 12:39:20 +0000
commitfc0ed57a5f25d8a7b3fbf200224bd880ed05eff5 (patch)
treeb8770d1adfa7d583395df86686b4458d0663e0f3 /runtime/mirror/array-alloc-inl.h
parentd3472f2a4c8214d3dc24a2c39d949562bb6be1db (diff)
Revert^3 "Object.clone() allocates more movable objects"
This reverts commit 1956542906d0b128a86975af009ba4601d02129a. Reason for revert: Droid Monitor created revert due to this b/363849521. Change-Id: Ic56e46bc11b1fd696b82f29782a1d1735ee805a9
Diffstat (limited to 'runtime/mirror/array-alloc-inl.h')
-rw-r--r--runtime/mirror/array-alloc-inl.h10
1 files changed, 6 insertions, 4 deletions
diff --git a/runtime/mirror/array-alloc-inl.h b/runtime/mirror/array-alloc-inl.h
index 69d2e2017f..b905fd1727 100644
--- a/runtime/mirror/array-alloc-inl.h
+++ b/runtime/mirror/array-alloc-inl.h
@@ -143,14 +143,16 @@ inline ObjPtr<Array> Array::Alloc(Thread* self,
ObjPtr<Array> result;
if (!kFillUsable) {
SetLengthVisitor visitor(component_count);
- result = ObjPtr<Array>::DownCast(heap->AllocObjectWithAllocator<kIsInstrumented>(
- self, array_class, size, allocator_type, visitor));
+ result = ObjPtr<Array>::DownCast(
+ heap->AllocObjectWithAllocator<kIsInstrumented>(
+ self, array_class, size, allocator_type, visitor));
} else {
SetLengthToUsableSizeVisitor visitor(component_count,
DataOffset(1U << component_size_shift).SizeValue(),
component_size_shift);
- result = ObjPtr<Array>::DownCast(heap->AllocObjectWithAllocator<kIsInstrumented>(
- self, array_class, size, allocator_type, visitor));
+ result = ObjPtr<Array>::DownCast(
+ heap->AllocObjectWithAllocator<kIsInstrumented>(
+ self, array_class, size, allocator_type, visitor));
}
if (kIsDebugBuild && result != nullptr && Runtime::Current()->IsStarted()) {
array_class = result->GetClass(); // In case the array class moved.