diff options
Diffstat (limited to 'runtime/mirror/object_array-alloc-inl.h')
-rw-r--r-- | runtime/mirror/object_array-alloc-inl.h | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/runtime/mirror/object_array-alloc-inl.h b/runtime/mirror/object_array-alloc-inl.h index e79d154f84..d3688762a4 100644 --- a/runtime/mirror/object_array-alloc-inl.h +++ b/runtime/mirror/object_array-alloc-inl.h @@ -66,9 +66,8 @@ inline ObjPtr<ObjectArray<T>> ObjectArray<T>::CopyOf(Handle<ObjectArray<T>> h_th int32_t new_length) { DCHECK_GE(new_length, 0); gc::Heap* heap = Runtime::Current()->GetHeap(); - gc::AllocatorType allocator_type = heap->IsMovableObject(h_this.Get()) - ? heap->GetCurrentAllocator() - : heap->GetCurrentNonMovingAllocator(); + DCHECK(heap->PossiblyAllocatedMovable(h_this.Get())); + gc::AllocatorType allocator_type = heap->GetCurrentAllocator(); ObjPtr<ObjectArray<T>> new_array = Alloc(self, h_this->GetClass(), new_length, allocator_type); if (LIKELY(new_array != nullptr)) { new_array->AssignableMemcpy(0, h_this.Get(), 0, std::min(h_this->GetLength(), new_length)); |