Re: [Gc] Suggested enhancements for improved support of embeddable subsystems

Ivan Maidanski ivmai at
Wed Jun 20 02:13:27 PDT 2012

Hi Jean-Claude,

Seems reasonable to me. Please provide git pull request on GitHub (against master branch).

Some remarks:
1. I don't think "const" is needed for "int status" and "msg" itself.
3. To forget to decorate functions with GC_API, GC_CALL and GC_CALLBACK. 
4. GC_set_thread_suspend/resume_signal should have effect only if called before GC_init
5. I guess it would be good to modify GC_INIT macro definition to setup suspend/resume signals via config macros at app compilation (e.g., via -DGC_SIG_SUSPEND=<n>)


Tue, 19 Jun 2012 23:50:41 -0400 Jean-Claude Beaudoin <jean.claude.beaudoin at>:
> Hi,
> As a user of this GC in an embeddable context (MKCL) I would like
> to suggest the following enhancements to the GC's API:
> 1) On platforms using signals to implement the stop-world/resume-world
> machinery, the choice of specific signal for SIG_SUSPEND and
> SIG_THR_RESTART should be configurable at GC_init() time instead
> of GC library compile time. This could be done through two simple
> external functions like:
> void GC_set_thread_suspend_signal(int);
> void GC_set_thread_restart_signal(int);
> plus two simple accessors used inside the GC code.
> 2) The embedding context needs to intercept any call to
> function abort() or function exit() that the GC may do. A pair of
> callback hooks would be very useful to achieve this.
> The API for this could be something like:
> typedef void (*GC_exit_func)(const int status);
> void GC_set_exit_func(GC_exit_func fn);
> typedef void (*GC_abort_func)(const char * const msg);
> void GC_set_abort_func(GC_abort_func fn);
> All of this can be quite easily implemented in a few lines
> of code. I could provide you with a copy of my current
> implementation if you would like, in a patch format or otherwise
> to your convenience.
> Regards,
> Jean-Claude Beaudoin

More information about the Gc mailing list