Bitmap naming clean-up.
Disambiguate bitmaps based on their use by adding a "curr" or "prev"
prefix. Also, fix names in a prototype to match the definition.
diff --git a/vm/alloc/HeapSource.h b/vm/alloc/HeapSource.h
index ab00889..84b5794 100644
--- a/vm/alloc/HeapSource.h
+++ b/vm/alloc/HeapSource.h
@@ -65,7 +65,7 @@
* Initializes a vector of object and mark bits to the object and mark
* bits of each heap.
*/
-void dvmHeapSourceGetObjectBitmaps(HeapBitmap objBits[], HeapBitmap markBits[],
+void dvmHeapSourceGetObjectBitmaps(HeapBitmap liveBits[], HeapBitmap markBits[],
size_t numHeaps);
/*
diff --git a/vm/alloc/MarkSweep.c b/vm/alloc/MarkSweep.c
index e0de3df..a5d31b5 100644
--- a/vm/alloc/MarkSweep.c
+++ b/vm/alloc/MarkSweep.c
@@ -1005,25 +1005,26 @@
void dvmHeapSweepUnmarkedObjects(GcMode mode, bool isConcurrent,
size_t *numObjects, size_t *numBytes)
{
- HeapBitmap markBits[HEAP_SOURCE_MAX_HEAP_COUNT];
- HeapBitmap liveBits[HEAP_SOURCE_MAX_HEAP_COUNT];
+ HeapBitmap currMark[HEAP_SOURCE_MAX_HEAP_COUNT];
+ HeapBitmap currLive[HEAP_SOURCE_MAX_HEAP_COUNT];
SweepContext ctx;
size_t numBitmaps, numSweepBitmaps;
size_t i;
numBitmaps = dvmHeapSourceGetNumHeaps();
- dvmHeapSourceGetObjectBitmaps(markBits, liveBits, numBitmaps);
+ dvmHeapSourceGetObjectBitmaps(currLive, currMark, numBitmaps);
if (mode == GC_PARTIAL) {
numSweepBitmaps = 1;
- assert((uintptr_t)gDvm.gcHeap->markContext.immuneLimit == liveBits[0].base);
+ assert((uintptr_t)gDvm.gcHeap->markContext.immuneLimit == currLive[0].base);
} else {
numSweepBitmaps = numBitmaps;
}
ctx.numObjects = ctx.numBytes = 0;
ctx.isConcurrent = isConcurrent;
for (i = 0; i < numSweepBitmaps; i++) {
- dvmHeapBitmapSweepWalk(&liveBits[i], &markBits[i],
- sweepBitmapCallback, &ctx);
+ HeapBitmap* prevLive = &currMark[i];
+ HeapBitmap* prevMark = &currLive[i];
+ dvmHeapBitmapSweepWalk(prevLive, prevMark, sweepBitmapCallback, &ctx);
}
*numObjects = ctx.numObjects;
*numBytes = ctx.numBytes;