Eliminate unused heap bitmap functions. This is mostly the "list"
code which is no longer needed.
Change-Id: I3636a4a6a36e55d2ad080571cdb6c23a16f98aaf
diff --git a/vm/alloc/HeapBitmap.c b/vm/alloc/HeapBitmap.c
index e2cf117..b42fc01 100644
--- a/vm/alloc/HeapBitmap.c
+++ b/vm/alloc/HeapBitmap.c
@@ -78,46 +78,6 @@
}
/*
- * Initialize <hb> so that it covers the same extent as <templateBitmap>.
- */
-bool
-dvmHeapBitmapInitFromTemplate(HeapBitmap *hb, const HeapBitmap *templateBitmap,
- const char *name)
-{
- return dvmHeapBitmapInit(hb,
- (void *)templateBitmap->base, HB_MAX_OFFSET(templateBitmap), name);
-}
-
-/*
- * Initialize the bitmaps in <out> so that they cover the same extent as
- * the corresponding bitmaps in <templates>.
- */
-bool
-dvmHeapBitmapInitListFromTemplates(HeapBitmap out[], HeapBitmap templates[],
- size_t numBitmaps, const char *name)
-{
- size_t i;
- char fullName[PATH_MAX];
-
- fullName[sizeof(fullName)-1] = '\0';
- for (i = 0; i < numBitmaps; i++) {
- bool ok;
-
- /* If two ashmem regions have the same name, only one gets
- * the name when looking at the maps.
- */
- snprintf(fullName, sizeof(fullName)-1, "%s/%zd", name, i);
-
- ok = dvmHeapBitmapInitFromTemplate(&out[i], &templates[i], fullName);
- if (!ok) {
- dvmHeapBitmapDeleteList(out, i);
- return false;
- }
- }
- return true;
-}
-
-/*
* Clean up any resources associated with the bitmap.
*/
void
@@ -132,19 +92,6 @@
}
/*
- * Clean up any resources associated with the bitmaps.
- */
-void
-dvmHeapBitmapDeleteList(HeapBitmap hbs[], size_t numBitmaps)
-{
- size_t i;
-
- for (i = 0; i < numBitmaps; i++) {
- dvmHeapBitmapDelete(&hbs[i]);
- }
-}
-
-/*
* Fill the bitmap with zeroes. Returns the bitmap's memory to
* the system as a side-effect.
*/
@@ -380,35 +327,3 @@
return dvmHeapBitmapXorWalk(hb, &emptyHb, callback, callbackArg);
}
-
-/*
- * Similar to dvmHeapBitmapXorWalkList(), but visit the set bits
- * in a single list of bitmaps. Regardless of the order of the array,
- * the bitmaps will be visited in address order, so that finger will
- * increase monotonically.
- */
-bool dvmHeapBitmapWalkList(const HeapBitmap hbs[], size_t numBitmaps,
- bool (*callback)(size_t numPtrs, void **ptrs,
- const void *finger, void *arg),
- void *callbackArg)
-{
- size_t indexList[numBitmaps];
- size_t i;
-
- /* Sort the bitmaps by address.
- */
- createSortedBitmapIndexList(hbs, numBitmaps, indexList);
-
- /* Walk each bitmap, lowest address first.
- */
- for (i = 0; i < numBitmaps; i++) {
- bool ok;
-
- ok = dvmHeapBitmapWalk(&hbs[indexList[i]], callback, callbackArg);
- if (!ok) {
- return false;
- }
- }
-
- return true;
-}
diff --git a/vm/alloc/HeapBitmap.h b/vm/alloc/HeapBitmap.h
index b9f8164..ec82a7a 100644
--- a/vm/alloc/HeapBitmap.h
+++ b/vm/alloc/HeapBitmap.h
@@ -86,29 +86,11 @@
const char *name);
/*
- * Initialize <hb> so that it covers the same extent as <templateBitmap>.
- */
-bool dvmHeapBitmapInitFromTemplate(HeapBitmap *hb,
- const HeapBitmap *templateBitmap, const char *name);
-
-/*
- * Initialize the bitmaps in <out> so that they cover the same extent as
- * the corresponding bitmaps in <templates>.
- */
-bool dvmHeapBitmapInitListFromTemplates(HeapBitmap out[],
- HeapBitmap templates[], size_t numBitmaps, const char *name);
-
-/*
* Clean up any resources associated with the bitmap.
*/
void dvmHeapBitmapDelete(HeapBitmap *hb);
/*
- * Clean up any resources associated with the bitmaps.
- */
-void dvmHeapBitmapDeleteList(HeapBitmap hbs[], size_t numBitmaps);
-
-/*
* Fill the bitmap with zeroes. Returns the bitmap's memory to
* the system as a side-effect.
*/
@@ -160,22 +142,6 @@
bool (*callback)(size_t numPtrs, void **ptrs,
const void *finger, void *arg),
void *callbackArg);
-/*
- * Return true iff <obj> is within the range of pointers that
- * have had corresponding bits set in this bitmap.
- */
-HB_INLINE_PROTO(
- bool
- dvmHeapBitmapMayContainObject(const HeapBitmap *hb,
- const void *obj)
-)
-{
- const uintptr_t p = (const uintptr_t)obj;
-
- assert((p & (HB_OBJECT_ALIGNMENT - 1)) == 0);
-
- return p >= hb->base && p <= hb->max;
-}
/*
* Return true iff <obj> is within the range of pointers that this
@@ -251,29 +217,6 @@
}
/*
- * Like dvmHeapBitmapSetAndReturnObjectBit(), but sets/returns the bit
- * in the appropriate bitmap. Results are undefined if <obj> is not
- * covered by any bitmap.
- */
-HB_INLINE_PROTO(
- unsigned long int
- dvmHeapBitmapSetAndReturnObjectBitInList(HeapBitmap hbs[],
- size_t numBitmaps, const void *obj)
-)
-{
- size_t i;
-
- for (i = 0; i < numBitmaps; i++) {
- if (dvmHeapBitmapCoversAddress(&hbs[i], obj)) {
- return dvmHeapBitmapSetAndReturnObjectBit(&hbs[i], obj);
- }
- }
-
- assert(!"object not covered by any bitmap");
- return false;
-}
-
-/*
* Sets the bit corresponding to <obj>, and widens the range of seen
* pointers if necessary. Does no range checking.
*/
@@ -320,27 +263,6 @@
}
}
-/*
- * Looks through the list of bitmaps and returns the current value of the
- * bit corresponding to <obj>, which may be covered by any of the bitmaps.
- * Does no range checking.
- */
-HB_INLINE_PROTO(
- long
- dvmHeapBitmapIsObjectBitSetInList(const HeapBitmap hbs[], size_t numBitmaps,
- const void *obj)
-)
-{
- size_t i;
-
- for (i = 0; i < numBitmaps; i++) {
- if (dvmHeapBitmapCoversAddress(&hbs[i], obj)) {
- return dvmHeapBitmapIsObjectBitSet(&hbs[i], obj);
- }
- }
- return false;
-}
-
#undef HB_INLINE_PROTO
#endif // _DALVIK_HEAP_BITMAP