diff options
-rw-r--r-- | runtime/gc/heap-inl.h | 3 | ||||
-rw-r--r-- | runtime/mirror/object_test.cc | 4 |
2 files changed, 5 insertions, 2 deletions
diff --git a/runtime/gc/heap-inl.h b/runtime/gc/heap-inl.h index 5eda0b9..6e9b04a 100644 --- a/runtime/gc/heap-inl.h +++ b/runtime/gc/heap-inl.h @@ -116,6 +116,9 @@ inline mirror::Object* Heap::TryToAllocate(Thread* self, AllocatorType allocator if (UNLIKELY(running_on_valgrind_ && allocator_type == kAllocatorTypeFreeList)) { return non_moving_space_->Alloc(self, alloc_size, bytes_allocated); } + } else { + // If running on valgrind, we should be using the instrumented path. + DCHECK(!running_on_valgrind_); } mirror::Object* ret; switch (allocator_type) { diff --git a/runtime/mirror/object_test.cc b/runtime/mirror/object_test.cc index 8272ff8..3637181 100644 --- a/runtime/mirror/object_test.cc +++ b/runtime/mirror/object_test.cc @@ -221,8 +221,8 @@ TEST_F(ObjectTest, CheckAndAllocArrayFromCode) { java_lang_dex_file_->GetIndexForStringId(*string_id)); ASSERT_TRUE(type_id != NULL); uint32_t type_idx = java_lang_dex_file_->GetIndexForTypeId(*type_id); - Object* array = CheckAndAllocArrayFromCode(type_idx, sort, 3, Thread::Current(), false, - Runtime::Current()->GetHeap()->GetCurrentAllocator()); + Object* array = CheckAndAllocArrayFromCodeInstrumented(type_idx, sort, 3, Thread::Current(), false, + Runtime::Current()->GetHeap()->GetCurrentAllocator()); EXPECT_TRUE(array->IsArrayInstance()); EXPECT_EQ(3, array->AsArray()->GetLength()); EXPECT_TRUE(array->GetClass()->IsArrayClass()); |