diff options
Diffstat (limited to 'runtime/mirror/array.cc')
-rw-r--r-- | runtime/mirror/array.cc | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/runtime/mirror/array.cc b/runtime/mirror/array.cc index 65371d0f5e..a4f6c88e4c 100644 --- a/runtime/mirror/array.cc +++ b/runtime/mirror/array.cc @@ -144,8 +144,9 @@ ObjPtr<Array> Array::CopyOf(Handle<Array> h_this, Thread* self, int32_t new_leng CHECK(klass->IsPrimitiveArray()) << "Will miss write barriers"; DCHECK_GE(new_length, 0); auto* heap = Runtime::Current()->GetHeap(); - DCHECK(!heap->IsNonMovable(h_this.Get())); - gc::AllocatorType allocator_type = heap->GetCurrentAllocator(); + gc::AllocatorType allocator_type = heap->IsMovableObject(h_this.Get()) + ? heap->GetCurrentAllocator() + : heap->GetCurrentNonMovingAllocator(); const auto component_size = klass->GetComponentSize(); const auto component_shift = klass->GetComponentSizeShift(); ObjPtr<Array> new_array = |