[Gc] Questions about finalizers

Lothar Scholz scholz at scriptolutions.com
Thu Apr 26 19:12:55 PDT 2007


I'm using "GC_register_finalizer" now in my Eiffel compiler and i
would like to know:

1) Can i make any assumption which thread will execute the
   finalizer code.
2) Is there some API to let the application do the finalizer
   calls? I would like to do this in a background thread
   and i would like to optimize the current situation
   which require to do a slow setjmp operation for any
   finalizer call (to catch thrown Eiffel exceptions -
   implemented with setjmp/longjmp)

3) Is it possible to add a debugging mode where _EVERY_
   object has a finalizer which is used to keep a list
   of all objects in the system to do some profiling and
   to find memory leaks.
   The system will have a few hundert thousands or even
   millions of objects.
4) Are there any optimizations if i can garantee that
   the objects are never made reachable again by the finalizer?

Best regards,
 Lothar Scholz              mailto:scholz at scriptolutions.com

More information about the Gc mailing list