return 1;
}
+/* Finalizer proc support */
+static void (*GC_object_finalized_proc) (GC_PTR obj);
+
+void
+GC_set_finalizer_notify_proc (void (*proc) (GC_PTR obj))
+{
+ GC_object_finalized_proc = proc;
+}
+
#ifndef GC_LONG_REFS_NOT_NEEDED
GC_API int GC_CALL GC_register_long_link(void * * link, const void * obj)
{
fo_set_next(prev_fo, next_fo);
}
GC_fo_entries--;
+
+ if (GC_object_finalized_proc)
+ GC_object_finalized_proc (real_ptr);
+
/* Add to list of objects awaiting finalization. */
fo_set_next(curr_fo, GC_finalize_now);
GC_finalize_now = curr_fo;
/* Similar to GC_unregister_disappearing_link but for a */
/* registration by either of the above two routines. */
+/* finalizer callback support */
+GC_API void GC_set_finalizer_notify_proc GC_PROTO((void (*object_finalized) (GC_PTR obj)));
+
/* Returns !=0 if GC_invoke_finalizers has something to do. */
GC_API int GC_CALL GC_should_invoke_finalizers(void);