Not all targets that support building libdruntime have a stable garbage
collector, so to avoid running into problems where live memory allocated
by the D GC is freed, disable all in-flight collections until a time
when scanning is more reliably implemented everywhere.
PR d/103520
gcc/d/ChangeLog:
* d-frontend.h (gc_disable): Declare.
* d-lang.cc (d_init_options): Disable the D runtime garbage collector
after initializing.
/* These functions are defined in D runtime. */
extern "C" int rt_init (void);
extern "C" int rt_term (void);
-//extern "C" void gc_disable (void);
+extern "C" void gc_disable (void);
extern "C" void *gc_malloc (size_t sz, unsigned ba = 0, const void *ti = NULL);
extern "C" void gc_free (void *);
extern "C" void gc_collect (void);
{
/* Initialize the D runtime. */
rt_init ();
-// gc_disable ();
+ gc_disable ();
/* Set default values. */
global._init ();