}
}
+void final_set_all_reclaimable()
+{
+ final_entry *fe;
+
+ fe = list_first(final_list);
+ while (fe) {
+
+ if (fe->type == FINAL_REACHABLE)
+ fe->type = FINAL_RECLAIMABLE;
+
+ fe = list_next(final_list, fe);
+ }
+}
+
/*
* These are local overrides for various environment variables in Emacs.
Forces the finalization of all objects on the Java Heap.
This is the function which is called by java.lang.Runtime.exit()
+ We do this by setting all objects with finalizers to reclaimable,
+ which is inherently dangerouse because objects may still be alive.
+
*******************************************************************************/
void gc_finalize_all(void)
{
- vm_abort("gc_finalize_all: IMPLEMENT ME!");
+#if !defined(NDEBUG)
+ /* doing this is deprecated, inform the user */
+ dolog("gc_finalize_all: Deprecated!");
+#endif
+
+ /* set all objects with finalizers to reclaimable */
+ final_set_all_reclaimable();
+
+ /* notify the finalizer thread */
+ finalizer_notify();
}
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
02110-1301, USA.
- $Id: nogc.c 7596 2007-03-28 21:05:53Z twisti $
+ $Id: nogc.c 7601 2007-03-28 23:02:50Z michi $
*/