From c6eb96785b4e041128c4ba21b78a6c0b4eae28e7 Mon Sep 17 00:00:00 2001 From: Carl Shapiro Date: Wed, 8 Dec 2010 15:40:24 -0800 Subject: [PATCH] Compute the pointer buffer size from familiar constants. Change-Id: Ibe4260c508417b015537fbee4f0dc78329450cbf --- vm/alloc/HeapBitmap.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/vm/alloc/HeapBitmap.c b/vm/alloc/HeapBitmap.c index 7304cd6bc..3ec5ab182 100644 --- a/vm/alloc/HeapBitmap.c +++ b/vm/alloc/HeapBitmap.c @@ -88,8 +88,7 @@ dvmHeapBitmapZero(HeapBitmap *hb) void dvmHeapBitmapSweepWalk(const HeapBitmap *liveHb, const HeapBitmap *markHb, BitmapSweepCallback *callback, void *callbackArg) { - static const size_t kPointerBufSize = 128; - void *pointerBuf[kPointerBufSize]; + void *pointerBuf[4 * HB_BITS_PER_WORD]; void **pb = pointerBuf; size_t index; size_t i; @@ -124,7 +123,7 @@ void dvmHeapBitmapSweepWalk(const HeapBitmap *liveHb, const HeapBitmap *markHb, } /* Make sure that there are always enough slots available */ /* for an entire word of 1s. */ - if (kPointerBufSize - (pb - pointerBuf) < HB_BITS_PER_WORD) { + if (NELEM(pointerBuf) - (pb - pointerBuf) < HB_BITS_PER_WORD) { (*callback)(pb - pointerBuf, pointerBuf, callbackArg); pb = pointerBuf; } -- 2.11.0