Mark non-image spaces and use write barrier for image spaces.
Don't mark string and class roots that are in the image, alloc space
references will be caught by the write barrier.
Change-Id: Idcf9e4ede3b83556d4f8a01276273726dc6eea46
diff --git a/src/space.h b/src/space.h
index eff0da5..9300be3 100644
--- a/src/space.h
+++ b/src/space.h
@@ -51,6 +51,8 @@
size_t Free(void* ptr);
+ size_t FreeList(size_t num_ptrs, void** ptrs);
+
void Trim();
size_t GetMaxAllowedFootprint();
@@ -66,6 +68,10 @@
return growth_limit_;
}
+ byte* GetMax() const {
+ return base_ + maximum_size_;
+ }
+
const std::string& GetName() const {
return name_;
}
@@ -99,6 +105,11 @@
void Walk(void(*callback)(const void*, size_t, const void*, size_t, void*), void* arg);
+ bool Contains(const Object* obj) const {
+ const byte* byte_ptr = reinterpret_cast<const byte*>(obj);
+ return GetBase() <= byte_ptr && byte_ptr < GetLimit();
+ }
+
private:
// The boundary tag overhead.
static const size_t kChunkOverhead = kWordSize;