When aliasing a bitmap, use smallest available limit.

The original implementation of the bitmap aliasing routine chose the
conservative max value of the heap limit.  This is perfect for the
zygote but is oversized for application heaps that are not anywhere
near full.  Now the code consults the live bitmap and will use its max
value if it is smaller than the heap limit.

Change-Id: I7cf223efdeaed318922a8a5f9e147092e539da6c
diff --git a/vm/alloc/HeapSource.c b/vm/alloc/HeapSource.c
index f55ccc5..1d82cfa 100644
--- a/vm/alloc/HeapSource.c
+++ b/vm/alloc/HeapSource.c
@@ -705,9 +705,10 @@
     HS_BOILERPLATE();
 
     assert(numHeaps == hs->numHeaps);
+    assert(hs->liveBits.max >= hs->markBits.max);
     for (i = 0; i < hs->numHeaps; ++i) {
         base = (uintptr_t)hs->heaps[i].base;
-        max = (uintptr_t)hs->heaps[i].limit - 1;
+        max = MIN((uintptr_t)hs->heaps[i].limit - 1, hs->liveBits.max);
         aliasBitmap(&liveBits[i], &hs->liveBits, base, max);
         aliasBitmap(&markBits[i], &hs->markBits, base, max);
     }