From 05e713a3a009a0825826ce6d494582fcd6dd6a8d Mon Sep 17 00:00:00 2001 From: Hiroshi Yamauchi Date: Thu, 9 Jan 2014 13:24:51 -0800 Subject: 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 --- runtime/gc/heap.h | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'runtime/gc/heap.h') 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(rosalloc_space_); + } else { + DCHECK(dlmalloc_space_ != nullptr); + return reinterpret_cast(dlmalloc_space_); + } + } + void DumpSpaces(std::ostream& stream = LOG(INFO)); // GC performance measuring -- cgit v1.2.3-59-g8ed1b