Use the global maximum to compute the size of a new mspace.
The global maximum was used for the initial specificaion but a local
maximum was used for post-Zygote mspace creations. This prevented a
clearing of the growth limit from having the intended effect.
Bug: 3414804
Change-Id: I47e0c1510f2212849e3b738c5578bbd7b1aff27d
diff --git a/vm/alloc/HeapSource.c b/vm/alloc/HeapSource.c
index e3cb422..764b2a3 100644
--- a/vm/alloc/HeapSource.c
+++ b/vm/alloc/HeapSource.c
@@ -366,7 +366,7 @@
hs->heaps[0].maximumSize = overhead;
hs->heaps[0].limit = base;
heap.maximumSize = hs->growthLimit - overhead;
- heap.msp = createMspace(base, HEAP_MIN_FREE, heap.maximumSize);
+ heap.msp = createMspace(base, HEAP_MIN_FREE, hs->maximumSize - overhead);
heap.concurrentStartBytes = HEAP_MIN_FREE - CONCURRENT_START;
heap.base = base;
heap.limit = heap.base + heap.maximumSize;