Refactor sweeping logic into malloc space.
Removes duplicated code in MarkSweep/SemiSpace.
Deleted VerifyImageRoots since it had race conditions and is tested
by pre/post GC heap verification.
Change-Id: I9636359ff6adb3e93d56ce77a3e15299ed23dfd5
diff --git a/runtime/gc/space/malloc_space.h b/runtime/gc/space/malloc_space.h
index d25f9cb..7681b6d 100644
--- a/runtime/gc/space/malloc_space.h
+++ b/runtime/gc/space/malloc_space.h
@@ -148,6 +148,9 @@
// don't do this we may get heap corruption instead of a segfault at null.
virtual void InvalidateAllocator() = 0;
+ // Sweep the references in the malloc space.
+ void Sweep(bool swap_bitmaps, size_t* freed_objects, size_t* freed_bytes);
+
protected:
MallocSpace(const std::string& name, MemMap* mem_map, byte* begin, byte* end,
byte* limit, size_t growth_limit);