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/native/java_lang_Runtime.c | |
| 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/native/java_lang_Runtime.c')
| -rw-r--r-- | vm/native/java_lang_Runtime.c | 27 |
1 files changed, 0 insertions, 27 deletions
diff --git a/vm/native/java_lang_Runtime.c b/vm/native/java_lang_Runtime.c index b5c6a3362..112448c78 100644 --- a/vm/native/java_lang_Runtime.c +++ b/vm/native/java_lang_Runtime.c @@ -93,31 +93,6 @@ static void Dalvik_java_lang_Runtime_nativeLoad(const u4* args, } /* - * public void runFinalization(boolean forced) - * - * Requests that the VM runs finalizers for objects on the heap. If the - * parameter forced is true, then the VM needs to ensure finalization. - * Otherwise this only inspires the VM to make a best-effort attempt to - * run finalizers before returning, but it's not guaranteed to actually - * do anything. - */ -static void Dalvik_java_lang_Runtime_runFinalization(const u4* args, - JValue* pResult) -{ - bool forced = (args[0] != 0); - - dvmWaitForHeapWorkerIdle(); - if (forced) { - // TODO(Google) Need to explicitly implement this, - // although dvmWaitForHeapWorkerIdle() - // should usually provide the "forced" - // behavior already. - } - - RETURN_VOID(); -} - -/* * public long maxMemory() * * Returns GC heap max memory in bytes. @@ -166,8 +141,6 @@ const DalvikNativeMethod dvm_java_lang_Runtime[] = { Dalvik_java_lang_Runtime_nativeExit }, { "nativeLoad", "(Ljava/lang/String;Ljava/lang/ClassLoader;)Ljava/lang/String;", Dalvik_java_lang_Runtime_nativeLoad }, - { "runFinalization", "(Z)V", - Dalvik_java_lang_Runtime_runFinalization }, { "totalMemory", "()J", Dalvik_java_lang_Runtime_totalMemory }, { NULL, NULL, NULL }, |
