OSDN Git Service

Allow allocation during a concurrent GC.
authorCarl Shapiro <cshapiro@google.com>
Fri, 2 Jul 2010 00:44:46 +0000 (17:44 -0700)
committerCarl Shapiro <cshapiro@google.com>
Fri, 2 Jul 2010 00:44:46 +0000 (17:44 -0700)
commitec47e2e081dcd43dca10d5e2c6856f73e94b0460
treea082957e4ef85bd2c931da73d9fa06781d80e1e7
parent44104e90d39c3d902de5120c84b23096ce26ea4e
Allow allocation during a concurrent GC.

Previously, any thread performing a GC held the heap lock for the
entire GC.  If the GC performed was a concurrent GC, mutator threads
that allocate during the GC would be blocked until the GC completed.

With this change, if the GC performed is a concurrent GC, the heap
lock is released while the roots are being traced.  If a mutator
thread allocates an object from available storage, the allocation
proceeds.  If a mutator thread attempts to allocate an object larger
than available storage, the thread will block until the GC completes.

Change-Id: I91a04179c6f583f878b685405a6fdd16b9995017
vm/Globals.h
vm/alloc/Heap.c
vm/alloc/Heap.h
vm/alloc/HeapSource.c