[Gc] Is GC_init callable multiple times?

Alex xtzgzorex at gmail.com
Thu Mar 1 12:01:56 PST 2012


Is the GC_init() function callable multiple times? In my case, I'm
wrapping libgc in a class in an OO language, so it is easiest to
simply call GC_init() in the constructor for said class. This means
that it may well be called multiple times, however. Looking at the
GC_init() and GC_init_inner() implementations in misc.c suggests that
at least some sanity checks are done to ensure double-initialization
doesn't happen even if GC_init() is called multiple times. However,
this behavior doesn't seem to be documented anywhere, so I'm unsure
whether calling GC_init() multiple times is considered sane and is
part of the interface?

Thanks in advance,

More information about the Gc mailing list