OSDN Git Service

Use the global maximum to compute the size of a new mspace.
authorCarl Shapiro <cshapiro@google.com>
Wed, 2 Feb 2011 04:19:04 +0000 (20:19 -0800)
committerCarl Shapiro <cshapiro@google.com>
Wed, 2 Feb 2011 04:19:04 +0000 (20:19 -0800)
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

vm/alloc/HeapSource.c

index e3cb422..764b2a3 100644 (file)
@@ -366,7 +366,7 @@ addNewHeap(HeapSource *hs, mspace msp, size_t maximumSize)
         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;