Large object space
The large object space helps prevent fragmentation by putting large objects in mem maps insead of the alloc space.
Instead of mark and live bitmaps it uses mark and live sets.
Change-Id: Iada5db70b88a1572007d8af921fa353681a55dc7
diff --git a/src/space_bitmap.cc b/src/space_bitmap.cc
index d117c21..b0b9d90 100644
--- a/src/space_bitmap.cc
+++ b/src/space_bitmap.cc
@@ -30,6 +30,12 @@
name_ = name;
}
+void SpaceSetMap::Walk(SpaceBitmap::Callback* callback, void* arg) {
+ for (Objects::iterator it = contained_.begin(); it != contained_.end(); ++it) {
+ callback(const_cast<Object*>(*it), arg);
+ }
+}
+
SpaceBitmap* SpaceBitmap::Create(const std::string& name, byte* heap_begin, size_t heap_capacity) {
CHECK(heap_begin != NULL);
// Round up since heap_capacity is not necessarily a multiple of kAlignment * kBitsPerWord.
@@ -251,6 +257,22 @@
}
}
+std::string SpaceSetMap::GetName() const {
+ return name_;
+}
+
+void SpaceSetMap::SetName(const std::string& name) {
+ name_ = name;
+}
+
+SpaceSetMap::SpaceSetMap(const std::string& name) : name_(name) {
+
+}
+
+void SpaceSetMap::CopyFrom(const SpaceSetMap& space_set) {
+ contained_ = space_set.contained_;
+}
+
std::ostream& operator << (std::ostream& stream, const SpaceBitmap& bitmap) {
return stream
<< bitmap.GetName() << "["