Limit scanning to cards within the committed region of the heap.

The initial implementation of the card scanning routine scanned all
cards in the card table.  For heaps that are less than the maximum
allowed size time was wasted scanning cards that are never dirtied.

Change-Id: I599c53a1777bf38b4d7b19438eb7584f9ba578ec
diff --git a/vm/alloc/MarkSweep.c b/vm/alloc/MarkSweep.c
index 2298ad2..eed3728 100644
--- a/vm/alloc/MarkSweep.c
+++ b/vm/alloc/MarkSweep.c
@@ -613,9 +613,12 @@
 {
     GcHeap *h = gDvm.gcHeap;
     u1 *card, *baseCard, *limitCard;
+    size_t footprint;
 
+    footprint = dvmHeapSourceGetValue(HS_FOOTPRINT, NULL, 0);
     baseCard = &h->cardTableBase[0];
-    limitCard = &h->cardTableBase[h->cardTableLength];
+    limitCard = dvmCardFromAddr(dvmHeapSourceGetBase() + footprint);
+    assert(limitCard <= &h->cardTableBase[h->cardTableLength]);
     for (card = baseCard; card != limitCard; ++card) {
         if (*card == GC_CARD_DIRTY) {
             /*