Enable concurrent sweeping
Now we unlock the heap during the sweeping process. When sweeping, the heap is only locked when dealing with dlmalloc.
Change-Id: I705ac499adbf0039a3e57d2c5d354b1087317032
diff --git a/src/heap_bitmap.cc b/src/heap_bitmap.cc
index c7b2f6c..7d81a5d 100644
--- a/src/heap_bitmap.cc
+++ b/src/heap_bitmap.cc
@@ -1,2 +1,16 @@
#include "heap_bitmap.h"
+namespace art {
+
+void HeapBitmap::ReplaceBitmap(SpaceBitmap* old_bitmap, SpaceBitmap* new_bitmap) {
+ // TODO: C++0x auto
+ for (Bitmaps::iterator cur = bitmaps_.begin(); cur != bitmaps_.end(); ++cur) {
+ if (*cur == old_bitmap) {
+ *cur = new_bitmap;
+ return;
+ }
+ }
+ LOG(FATAL) << "bitmap " << static_cast<const void*>(old_bitmap) << " not found";
+}
+
+} // namespace art