summaryrefslogtreecommitdiff
path: root/runtime/gc/heap.h
diff options
context:
space:
mode:
author Hiroshi Yamauchi <yamauchi@google.com> 2014-01-09 13:24:51 -0800
committer Hiroshi Yamauchi <yamauchi@google.com> 2014-01-10 18:36:47 -0800
commit05e713a3a009a0825826ce6d494582fcd6dd6a8d (patch)
treea2c48b5698b687c46d5582a2984db46f7271865f /runtime/gc/heap.h
parent6502d15fa7a92498cb3bcb291426cc10dd952fe4 (diff)
Bump pointer space only collection.
Add a mode of collection that collects only the bump pointer spaces, as opposed to the whole heap. It's disabled behind a flag. TODO: It still scans the entire non-moving space to look for inter-space references. Use a card table like technique to limit the scope of scanning and speed it up. Bug: 11650816 Change-Id: I56cb11e78e47a578bff644e6e6c63d978cfedf39
Diffstat (limited to 'runtime/gc/heap.h')
-rw-r--r--runtime/gc/heap.h15
1 files changed, 15 insertions, 0 deletions
diff --git a/runtime/gc/heap.h b/runtime/gc/heap.h
index cc4d7be11f..465ee4c0da 100644
--- a/runtime/gc/heap.h
+++ b/runtime/gc/heap.h
@@ -495,6 +495,21 @@ class Heap {
return large_object_space_;
}
+ // Returns the free list space that may contain movable objects (the
+ // one that's not the non-moving space), either rosalloc_space_ or
+ // dlmalloc_space_.
+ space::MallocSpace* GetPrimaryFreeListSpace() {
+ if (kUseRosAlloc) {
+ DCHECK(rosalloc_space_ != nullptr);
+ // reinterpret_cast is necessary as the space class hierarchy
+ // isn't known (#included) yet here.
+ return reinterpret_cast<space::MallocSpace*>(rosalloc_space_);
+ } else {
+ DCHECK(dlmalloc_space_ != nullptr);
+ return reinterpret_cast<space::MallocSpace*>(dlmalloc_space_);
+ }
+ }
+
void DumpSpaces(std::ostream& stream = LOG(INFO));
// GC performance measuring