From da44d773dedf8aae6153e3423012f236cba3bfcd Mon Sep 17 00:00:00 2001 From: Mathieu Chartier Date: Tue, 1 Apr 2014 15:01:46 -0700 Subject: Fix running with DlMalloc instead of RosAlloc. Bug: 13748830 Bug: 13744490 Change-Id: Ieec97cf58ebf9864a40ee85aae582cdcf3f27c0c --- runtime/gc/heap.cc | 3 +-- runtime/gc/space/dlmalloc_space.cc | 2 +- runtime/gc/space/large_object_space.cc | 2 +- 3 files changed, 3 insertions(+), 4 deletions(-) (limited to 'runtime/gc') diff --git a/runtime/gc/heap.cc b/runtime/gc/heap.cc index 1a32a9a..1bfe9bf 100644 --- a/runtime/gc/heap.cc +++ b/runtime/gc/heap.cc @@ -21,7 +21,6 @@ #include #include -#include #include "base/histogram-inl.h" #include "base/stl_util.h" @@ -150,7 +149,7 @@ Heap::Heap(size_t initial_size, size_t growth_limit, size_t min_free, size_t max total_allocation_time_(0), verify_object_mode_(kVerifyObjectModeDisabled), disable_moving_gc_count_(0), - running_on_valgrind_(RUNNING_ON_VALGRIND > 0), + running_on_valgrind_(Runtime::Current()->RunningOnValgrind()), use_tlab_(use_tlab) { if (VLOG_IS_ON(heap) || VLOG_IS_ON(startup)) { LOG(INFO) << "Heap() entering"; diff --git a/runtime/gc/space/dlmalloc_space.cc b/runtime/gc/space/dlmalloc_space.cc index 30c2edb..60f566c 100644 --- a/runtime/gc/space/dlmalloc_space.cc +++ b/runtime/gc/space/dlmalloc_space.cc @@ -60,7 +60,7 @@ DlMallocSpace* DlMallocSpace::CreateFromMemMap(MemMap* mem_map, const std::strin // Everything is set so record in immutable structure and leave byte* begin = mem_map->Begin(); - if (Runtime::Current()->GetHeap()->RunningOnValgrind()) { + if (Runtime::Current()->RunningOnValgrind()) { return new ValgrindMallocSpace( name, mem_map, mspace, begin, end, begin + capacity, growth_limit, initial_size); } else { diff --git a/runtime/gc/space/large_object_space.cc b/runtime/gc/space/large_object_space.cc index 2fc67ec..0b353c7 100644 --- a/runtime/gc/space/large_object_space.cc +++ b/runtime/gc/space/large_object_space.cc @@ -97,7 +97,7 @@ LargeObjectMapSpace::LargeObjectMapSpace(const std::string& name) lock_("large object map space lock", kAllocSpaceLock) {} LargeObjectMapSpace* LargeObjectMapSpace::Create(const std::string& name) { - if (RUNNING_ON_VALGRIND > 0) { + if (Runtime::Current()->RunningOnValgrind()) { return new ValgrindLargeObjectMapSpace(name); } else { return new LargeObjectMapSpace(name); -- cgit v1.1