diff options
| author | Carl Shapiro <cshapiro@google.com> | 2011-03-21 13:35:24 -0700 |
|---|---|---|
| committer | Carl Shapiro <cshapiro@google.com> | 2011-03-21 13:35:24 -0700 |
| commit | 3475f9cdb47a6d6f8ad2ce49bbc3af46bca92f09 (patch) | |
| tree | 32bccadbd08a353a4650a6451218b0c854ec6fc2 /vm/alloc/HeapInternal.h | |
| parent | 14b63ca9f3ba5b58c6f8ad703c7a9c68028aa230 (diff) | |
| download | android_dalvik-3475f9cdb47a6d6f8ad2ce49bbc3af46bca92f09.tar.gz android_dalvik-3475f9cdb47a6d6f8ad2ce49bbc3af46bca92f09.tar.bz2 android_dalvik-3475f9cdb47a6d6f8ad2ce49bbc3af46bca92f09.zip | |
Move finalization out of the VM.
This change introduces a new reference class whose referent
points to instances requiring finalization. This makes the
finalization of objects possible using a reference queue and
a dedicated thread which removes objects from the queue.
Change-Id: I0ff6dd272f00ca08c6ed3aa667bf766a039a944e
Diffstat (limited to 'vm/alloc/HeapInternal.h')
| -rw-r--r-- | vm/alloc/HeapInternal.h | 30 |
1 files changed, 4 insertions, 26 deletions
diff --git a/vm/alloc/HeapInternal.h b/vm/alloc/HeapInternal.h index d10a41708..7f8c9c5e3 100644 --- a/vm/alloc/HeapInternal.h +++ b/vm/alloc/HeapInternal.h @@ -29,37 +29,15 @@ typedef struct HeapSource HeapSource; struct GcHeap { HeapSource *heapSource; - /* List of heap objects that will require finalization when - * collected. I.e., instance objects - * - * a) whose class definitions override java.lang.Object.finalize() - * - * *** AND *** - * - * b) that have never been finalized. - * - * Note that this does not exclude non-garbage objects; this - * is not the list of pending finalizations, but of objects that - * potentially have finalization in their futures. - */ - LargeHeapRefTable *finalizableRefs; - - /* The list of objects that need to have finalize() called - * on themselves. These references are part of the root set. - * - * This table is protected by gDvm.heapWorkerListLock, which must - * be acquired after the heap lock. - */ - LargeHeapRefTable *pendingFinalizationRefs; - /* Linked lists of subclass instances of java/lang/ref/Reference * that we find while recursing. The "next" pointers are hidden * in the objects' <code>int Reference.vmData</code> fields. * These lists are cleared and rebuilt each time the GC runs. */ - Object *softReferences; - Object *weakReferences; - Object *phantomReferences; + Object *softReferences; + Object *weakReferences; + Object *finalizerReferences; + Object *phantomReferences; /* The list of Reference objects that need to be cleared and/or * enqueued. The bottom two bits of the object pointers indicate |
