OSDN Git Service

When aliasing a bitmap, use smallest available limit.
authorBarry Hayes <bhayes@google.com>
Thu, 15 Jul 2010 15:58:10 +0000 (08:58 -0700)
committerBarry Hayes <bhayes@google.com>
Tue, 20 Jul 2010 23:40:03 +0000 (16:40 -0700)
commit73f3e6f5ef9eda738324bcd5634df172d9c6e977
tree831493094595ac86fd4f5a0813eb4084d342c5ad
parent25f00e3e95a79b75d2829baedb67a5521a725bbd
When aliasing a bitmap, use smallest available limit.

dvmHeapSourceGetObjectBitmaps was using each Heap's allocation limit
to set the max for the bitmap. This causes the HeapBitmap iterators to
do unnecessary work, over parts of the HeapBitmap which could be known
to be all zeros.

Making the max for a HeapBitmap also take into account the liveBits's
max will inform the HeapBitmap iterators that these regions are all
zeros. This will only change the calculation for the active allocation
Heap; but when there are two Heaps, the Zygote Heap is expected to be
pretty well packed, with not a lot of extra words of zeroes in the
HeapBitmap.

Also fixes a defect in aliasBitmap's calculation of bitsLen.
See http://b/issue?id=2857152

Change-Id: Iacb6bc400318702d760a774c6ca5eab67b8bdfd3
vm/alloc/HeapBitmap.c
vm/alloc/HeapSource.c