OSDN Git Service

Always grow the limit address of the a heap along with its size.
authorCarl Shapiro <cshapiro@google.com>
Wed, 15 Jun 2011 03:51:45 +0000 (20:51 -0700)
committerCarl Shapiro <cshapiro@google.com>
Wed, 15 Jun 2011 03:51:45 +0000 (20:51 -0700)
Previously, clearing the growth limit only updated the maximumSize of
the unlimited heap without updating the limit value.  This caused any
operations iterated over the extent of the heap to ignore allocations
beyond the original heap size.  With this change the limit is always
kept in agreement with the maximumSize.

Bug: 4539441
Change-Id: I08c8004e724549d196e1fd5d6ad22efc85b0c8d2

vm/alloc/HeapSource.c

index 764b2a3..841649f 100644 (file)
@@ -1116,6 +1116,7 @@ void dvmClearGrowthLimit()
     gHs->growthLimit = gHs->maximumSize;
     overhead = oldHeapOverhead(gHs, false);
     gHs->heaps[0].maximumSize = gHs->maximumSize - overhead;
+    gHs->heaps[0].limit = gHs->heaps[0].base + gHs->heaps[0].maximumSize;
     dvmUnlockHeap();
 }