unofficial mirror of guile-devel@gnu.org 
 help / color / mirror / Atom feed
From: "Jose E. Marchesi" <jemarch@gnu.org>
To: guile-devel@gnu.org
Cc: ludo@gnu.org
Subject: [RFC,PATCH] Do not GC_INIT the Boehm GC if already initialized
Date: Mon, 06 Feb 2023 19:34:05 +0100	[thread overview]
Message-ID: <87ttzybq3m.fsf@gnu.org> (raw)


Hello Guile hackers.

We are in the process of integrating GNU poke[1] in GDB by mean of
libpoke.

Problem is, libpoke uses the Boehm GC, as guile does.  We are working on
switching to an ad-hoc exact collector, but it will get some time.

So, in the interim, we may:

1) Make both libguile and libpoke to do GC_INIT conditionally, only if
   no one else has initialized the collector before.  This is already in
   poke master.  A suggested (untested!) patch for guile below.

2) Test to see if the collector works properly.

3) Do bug-fix releases of both libguile and libpoke so the GDB people
   can check for the right version in configure.ac in order to allow
   configuring GDB with both libpoke and libguile support.

Does this sound like a plan?
Thanks in advance!

[1] https://jemarch.net/poke

diff --git a/libguile/gc.c b/libguile/gc.c
index 7717e9bef..36653d373 100644
--- a/libguile/gc.c
+++ b/libguile/gc.c
@@ -462,7 +462,8 @@ scm_storage_prehistory ()
   setenv ("GC_MARKERS", "1", 1);
 #endif
 
-  GC_INIT ();
+  if(!GC_is_init_called ())
+    GC_INIT ();
 
   size_t heap_size = GC_get_heap_size ();
   if (heap_size < DEFAULT_INITIAL_HEAP_SIZE)



             reply	other threads:[~2023-02-06 18:34 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-02-06 18:34 Jose E. Marchesi [this message]
2023-02-06 20:56 ` [RFC,PATCH] Do not GC_INIT the Boehm GC if already initialized Jean Abou Samra
2023-02-06 21:05   ` Jose E. Marchesi
2023-02-07 12:29 ` Maxime Devos
2023-02-20 10:06   ` Ludovic Courtès
2023-02-20 18:01     ` Maxime Devos
2023-02-20 22:00     ` Hans Åberg

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/guile/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87ttzybq3m.fsf@gnu.org \
    --to=jemarch@gnu.org \
    --cc=guile-devel@gnu.org \
    --cc=ludo@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).