Initialization of libraries (Re: GC of closures)

The initialization function for Bohem-GC is called by
atsruntime_minit_gcbdw:

ATSinline()
atsvoid_t0ype
atsruntime_minit_gcbdw
(/void/) { GC_init() ; return ; }
// end of [atsruntime_minit_gcbdw]

If you use -DATS_MEMALLOC_GCBDW, atsruntime_minit_gcbdw is automatically
called.On Tuesday, December 29, 2015 at 1:19:28 PM UTC-5, Barry Schwartz wrote:

Barry Schwartz <chem...@chemoelectric.org <javascript:>> skribis:

On Tue, Dec 29, 2015 at 12:10 PM, Mike Jones <pro...@gmail.com <javascript:>> wrote:

Since Bohem GC replaces alloc, does the ATS compiler really generate
different code for GC or does it just add some GC initiallization
code?

Hongwei Xi <gmh...@gmail.com <javascript:>> skribis:

ATS compiler generates the same code. It is just that certain
functions
(malloc, free, calloc, and realloc) are
hooked to different implementations (provided by different libraries).

Which works because on most architectures Boehm GC needs no
initialization.

The same would not be true if one used the Boehm GC wrappers in
libguile, for instance. I’m curious if there is a way to be sure
initialization is called before dynloads.

Urgh, that was probably a silly question. I would imagine just be sure
to put it in the first thing dynloaded.