Refactor space bitmap to be a value object
Remove the need for pointer indirections at many places, reduce the
amount of code.
Bug: 116052292
Test: test-art-host
Change-Id: I4b1040d29f9ba99ea23c51f70a06af2ffbe496d4
diff --git a/runtime/gc/space/image_space.h b/runtime/gc/space/image_space.h
index c020dc1..8cee20c 100644
--- a/runtime/gc/space/image_space.h
+++ b/runtime/gc/space/image_space.h
@@ -97,14 +97,14 @@
return image_location_;
}
- accounting::ContinuousSpaceBitmap* GetLiveBitmap() const override {
- return live_bitmap_.get();
+ accounting::ContinuousSpaceBitmap* GetLiveBitmap() override {
+ return &live_bitmap_;
}
- accounting::ContinuousSpaceBitmap* GetMarkBitmap() const override {
+ accounting::ContinuousSpaceBitmap* GetMarkBitmap() override {
// ImageSpaces have the same bitmap for both live and marked. This helps reduce the number of
// special cases to test against.
- return live_bitmap_.get();
+ return &live_bitmap_;
}
void Dump(std::ostream& os) const override;
@@ -191,12 +191,12 @@
static Atomic<uint32_t> bitmap_index_;
- std::unique_ptr<accounting::ContinuousSpaceBitmap> live_bitmap_;
+ accounting::ContinuousSpaceBitmap live_bitmap_;
ImageSpace(const std::string& name,
const char* image_location,
MemMap&& mem_map,
- std::unique_ptr<accounting::ContinuousSpaceBitmap> live_bitmap,
+ accounting::ContinuousSpaceBitmap&& live_bitmap,
uint8_t* end);
// The OatFile associated with the image during early startup to