From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: "Jose E. Marchesi" Newsgroups: gmane.lisp.guile.devel Subject: Re: [RFC,PATCH] Do not GC_INIT the Boehm GC if already initialized Date: Mon, 06 Feb 2023 22:05:47 +0100 Message-ID: <87lelabj2s.fsf@gnu.org> References: <87ttzybq3m.fsf@gnu.org> <29bad7bd-fad4-c835-cad9-488462efbe4f@abou-samra.fr> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="12846"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: guile-devel@gnu.org, ludo@gnu.org To: Jean Abou Samra Original-X-From: guile-devel-bounces+guile-devel=m.gmane-mx.org@gnu.org Mon Feb 06 22:07:33 2023 Return-path: Envelope-to: guile-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pP8i4-0003AJ-Nf for guile-devel@m.gmane-mx.org; Mon, 06 Feb 2023 22:07:32 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pP8hX-0007dd-J3; Mon, 06 Feb 2023 16:06:59 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pP8gj-0007Pb-1m for guile-devel@gnu.org; Mon, 06 Feb 2023 16:06:19 -0500 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pP8gg-0005Vr-0w; Mon, 06 Feb 2023 16:06:06 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:Date:References:In-Reply-To:Subject:To: From; bh=STrl46+By8FaUnvHA/lF6g6Z+gg35+PtsgcOxyKmq7E=; b=rpY5SdUF1YHxm3zI7+3w d+O7z9btobkJ8WJQowfkJQp2GK34Sx+iRzWHOhqch9O7GQeBypYJtJx9E1LGrM2JsfrclwcCKswoV yjZOQRWMj2Nm4jVeSgdJ2K+8L/hSI3FpuBLGXf6wR+4qdcRafeCXe7hD9FqyuqduB6R7wicxzAV9L theo53XOro5F4GyIgswcQ42+zKDhNFo+NzBDBTLijhijjfjAjck1u53n4+CMWnZgbhQ+CTuu56oBX pdiSR03EQYWanMxzYbzdOIIUZez/GUVymEqeH8lwGO+jeM5Hojs+eN0IYLiHJR8YCkGbolkNEgnh+ zyFx3AQeb8INUw==; Original-Received: from [141.143.193.70] (helo=termi) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pP8gf-0008FC-Dh; Mon, 06 Feb 2023 16:06:05 -0500 In-Reply-To: <29bad7bd-fad4-c835-cad9-488462efbe4f@abou-samra.fr> (Jean Abou Samra's message of "Mon, 6 Feb 2023 21:56:13 +0100") X-BeenThere: guile-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Developers list for Guile, the GNU extensibility library" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guile-devel-bounces+guile-devel=m.gmane-mx.org@gnu.org Original-Sender: guile-devel-bounces+guile-devel=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.lisp.guile.devel:21691 Archived-At: > On 06/02/2023 19:34, Jose E. Marchesi wrote: >> >> 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) >> > > > > Isn't that going to cause problems if the configurations clash? > For example, the scm_storage_prehistory () function that you > are modifying does > > GC_set_all_interior_pointers (0); > > If the application that previously initialized the GC relies > on interior pointer tracing, Guile disabling it is going to > cause trouble. Indeed, we would need to agree on these details and come with a configuration that works with both configurations.