public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc r12-5704] d: Disable the D runtime garbage collector after initializing (PR103520)
@ 2021-12-02 0:47 Iain Buclaw
0 siblings, 0 replies; only message in thread
From: Iain Buclaw @ 2021-12-02 0:47 UTC (permalink / raw)
To: gcc-cvs
https://gcc.gnu.org/g:fa10faa72d8e9e97b6e564f8b0a7b602538d0da0
commit r12-5704-gfa10faa72d8e9e97b6e564f8b0a7b602538d0da0
Author: Iain Buclaw <ibuclaw@gdcproject.org>
Date: Wed Dec 1 23:56:28 2021 +0100
d: Disable the D runtime garbage collector after initializing (PR103520)
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.
Diff:
---
gcc/d/d-frontend.h | 2 +-
gcc/d/d-lang.cc | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/gcc/d/d-frontend.h b/gcc/d/d-frontend.h
index 3edf812212a..e7695d5718b 100644
--- a/gcc/d/d-frontend.h
+++ b/gcc/d/d-frontend.h
@@ -21,7 +21,7 @@ along with GCC; see the file COPYING3. If not see
/* 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);
diff --git a/gcc/d/d-lang.cc b/gcc/d/d-lang.cc
index d20370e5d8a..dbf7a8b60b9 100644
--- a/gcc/d/d-lang.cc
+++ b/gcc/d/d-lang.cc
@@ -288,7 +288,7 @@ d_init_options (unsigned int, cl_decoded_option *decoded_options)
{
/* Initialize the D runtime. */
rt_init ();
-// gc_disable ();
+ gc_disable ();
/* Set default values. */
global._init ();
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2021-12-02 0:47 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-12-02 0:47 [gcc r12-5704] d: Disable the D runtime garbage collector after initializing (PR103520) Iain Buclaw
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).