diff options
| author | Carl Shapiro <cshapiro@google.com> | 2011-01-18 17:59:30 -0800 |
|---|---|---|
| committer | Carl Shapiro <cshapiro@google.com> | 2011-01-18 17:59:30 -0800 |
| commit | df9f08b877ecfd8ebadea822bb9e066ee7d30433 (patch) | |
| tree | 2ace664586d3f29a5183e6f71e2f8138c69cb83a /vm/alloc/CardTable.c | |
| parent | 241cec80a79551730122fb9dbc92a3527392b1de (diff) | |
| download | android_dalvik-df9f08b877ecfd8ebadea822bb9e066ee7d30433.tar.gz android_dalvik-df9f08b877ecfd8ebadea822bb9e066ee7d30433.tar.bz2 android_dalvik-df9f08b877ecfd8ebadea822bb9e066ee7d30433.zip | |
Implement growth limits to support multiple heap configurations.
When a growth limit is in effect, allocations will be limited to
number of bytes specified by the growth limit instead of the maximum
heap size. Growth limits are specified on the command line with the
new parameter -XX:HeapGrowthLimit. A growth limit can be removed at
runtime by calling the new clearGrowthLimit method.
This is a work around until we can adjust the maximum heap size at
runtime.
Change-Id: Ic01e32823b5ca8cf29c0948fb6cd2df10967c1fb
Diffstat (limited to 'vm/alloc/CardTable.c')
| -rw-r--r-- | vm/alloc/CardTable.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/vm/alloc/CardTable.c b/vm/alloc/CardTable.c index fcfe49ca8..02b6c47de 100644 --- a/vm/alloc/CardTable.c +++ b/vm/alloc/CardTable.c @@ -46,7 +46,7 @@ * Initializes the card table; must be called before any other * dvmCardTable*() functions. */ -bool dvmCardTableStartup(void) +bool dvmCardTableStartup(size_t heapMaximumSize) { size_t length; void *allocBase; @@ -57,7 +57,7 @@ bool dvmCardTableStartup(void) assert(heapBase != NULL); /* Set up the card table */ - length = gDvm.heapSizeMax / GC_CARD_SIZE; + length = heapMaximumSize / GC_CARD_SIZE; /* Allocate an extra 256 bytes to allow fixed low-byte of base */ allocBase = dvmAllocRegion(length + 0x100, PROT_READ | PROT_WRITE, "dalvik-card-table"); |
