diff options
author | Mathieu Chartier <mathieuc@google.com> | 2014-03-20 22:54:09 +0000 |
---|---|---|
committer | Gerrit Code Review <noreply-gerritcodereview@google.com> | 2014-03-20 22:54:09 +0000 |
commit | 06cad80971ec68a13aec1557fc5a149928ab8c8a (patch) | |
tree | b8f6f57a0f271c3122750c5602f21c6fc61f87be /runtime/gc | |
parent | abbce4c1258d4dce1152c370034b11e0dc56fdb5 (diff) | |
parent | 36bf21665b43adc2485167cbb3a044dbdf4931ee (diff) | |
download | art-06cad80971ec68a13aec1557fc5a149928ab8c8a.zip art-06cad80971ec68a13aec1557fc5a149928ab8c8a.tar.gz art-06cad80971ec68a13aec1557fc5a149928ab8c8a.tar.bz2 |
Merge "Add Heap::RunningOnValgrind and call it from the spaces."
Diffstat (limited to 'runtime/gc')
-rw-r--r-- | runtime/gc/heap.h | 3 | ||||
-rw-r--r-- | runtime/gc/space/dlmalloc_space.cc | 2 | ||||
-rw-r--r-- | runtime/gc/space/rosalloc_space.cc | 2 |
3 files changed, 5 insertions, 2 deletions
diff --git a/runtime/gc/heap.h b/runtime/gc/heap.h index eb53ba9..f650005 100644 --- a/runtime/gc/heap.h +++ b/runtime/gc/heap.h @@ -553,6 +553,9 @@ class Heap { void RemoveRememberedSet(space::Space* space); bool IsCompilingBoot() const; + bool RunningOnValgrind() const { + return running_on_valgrind_; + } bool HasImageSpace() const; private: diff --git a/runtime/gc/space/dlmalloc_space.cc b/runtime/gc/space/dlmalloc_space.cc index 0597422..30c2edb 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 (RUNNING_ON_VALGRIND > 0) { + if (Runtime::Current()->GetHeap()->RunningOnValgrind()) { return new ValgrindMallocSpace<DlMallocSpace, void*>( name, mem_map, mspace, begin, end, begin + capacity, growth_limit, initial_size); } else { diff --git a/runtime/gc/space/rosalloc_space.cc b/runtime/gc/space/rosalloc_space.cc index 80c7ca7..fbb2afe 100644 --- a/runtime/gc/space/rosalloc_space.cc +++ b/runtime/gc/space/rosalloc_space.cc @@ -65,7 +65,7 @@ RosAllocSpace* RosAllocSpace::CreateFromMemMap(MemMap* mem_map, const std::strin byte* begin = mem_map->Begin(); // TODO: Fix RosAllocSpace to support valgrind. There is currently some issues with // AllocationSize caused by redzones. b/12944686 - if (false && RUNNING_ON_VALGRIND > 0) { + if (false && Runtime::Current()->GetHeap()->RunningOnValgrind()) { return new ValgrindMallocSpace<RosAllocSpace, allocator::RosAlloc*>( name, mem_map, rosalloc, begin, end, begin + capacity, growth_limit, initial_size); } else { |