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
diff --git a/vm/alloc/Heap.h b/vm/alloc/Heap.h
index 95740c1..ea0510f 100644
--- a/vm/alloc/Heap.h
+++ b/vm/alloc/Heap.h
@@ -83,4 +83,10 @@
*/
void dvmCollectGarbageInternal(bool clearSoftRefs, GcReason reason);
+/*
+ * Blocks the until the GC thread signals the completion of a
+ * concurrent GC.
+ */
+void dvmWaitForConcurrentGcToComplete(void);
+
#endif // _DALVIK_ALLOC_HEAP