OSDN Git Service

Fix two issues with the card table.
authorCarl Shapiro <cshapiro@google.com>
Wed, 8 Jun 2011 04:42:44 +0000 (21:42 -0700)
committerCarl Shapiro <cshapiro@google.com>
Wed, 8 Jun 2011 04:42:49 +0000 (21:42 -0700)
commiteebf7c690a6aabd50d70779d72685090a1eb84ff
treebd245681527c45362424b6f8c6329b45082a6c12
parent689cc333b7be28b8b312f91999a31a2b0bd60c62
Fix two issues with the card table.

Several tricks are used to adjust the base of the card table to save
instructions in the write barrier.  This change corrects two
situtations where the card table did not properly account for the
effects of these tricks.

First, the card table is over allocated to ensure that the start
address can be magically aligned.  When releasing the allocation these
additional bytes were not supplied to munmap creating a potential
leak.

Second, the valid card check did not use the right base address for a
containment check.  The check used the allocation base which is may be
lower than the actual starting address.  This would cause valid cards
at the high end of the heap to be considered invalid and invalid cards
at the low end of the heap to be considered valid.

Change-Id: I83bf4167b7c081c8626b6ff504342f42d0e776a2
vm/alloc/CardTable.cpp
vm/alloc/HeapInternal.h