Refactor spaces and add free list large object space
Added some more abstraction for spaces, we now have ContinuousSpaces and DiscontinousSpaces.
Added a free list version of large object space.
Performance should be better than the memory map version since we avoid creating more than
one memory map.
Added a cause for Gc which prints with the Gc message, dalvik has this as well.
Change-Id: Ie4aa6b204fbde7193e8305eb246158fae0444cc1
diff --git a/src/mem_map.h b/src/mem_map.h
index c7744bb..1748a0e 100644
--- a/src/mem_map.h
+++ b/src/mem_map.h
@@ -72,7 +72,11 @@
}
byte* End() const {
- return begin_ + size_;
+ return Begin() + Size();
+ }
+
+ bool HasAddress(const void* addr) const {
+ return Begin() <= addr && addr < End();
}
// Trim by unmapping pages at the end of the map.