From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Jean Abou Samra Newsgroups: gmane.lisp.guile.devel Subject: Re: [RFC,PATCH] Do not GC_INIT the Boehm GC if already initialized Date: Mon, 6 Feb 2023 21:56:13 +0100 Message-ID: <29bad7bd-fad4-c835-cad9-488462efbe4f@abou-samra.fr> References: <87ttzybq3m.fsf@gnu.org> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="------------IWTvk80EVSGXcuBeXUkvfYFx" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="38708"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.6.0 Cc: ludo@gnu.org To: "Jose E. Marchesi" , guile-devel@gnu.org Original-X-From: guile-devel-bounces+guile-devel=m.gmane-mx.org@gnu.org Mon Feb 06 21:56:57 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 1pP8Xn-0009o2-HR for guile-devel@m.gmane-mx.org; Mon, 06 Feb 2023 21:56:55 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pP8XM-00016W-J4; Mon, 06 Feb 2023 15:56:29 -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 1pP8XF-000162-3A for guile-devel@gnu.org; Mon, 06 Feb 2023 15:56:22 -0500 Original-Received: from mout.kundenserver.de ([212.227.17.13]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pP8XB-0003yr-8r; Mon, 06 Feb 2023 15:56:18 -0500 Original-Received: from [10.188.149.104] ([46.193.67.184]) by mrelayeu.kundenserver.de (mreue106 [212.227.15.184]) with ESMTPSA (Nemesis) id 1Mj831-1ovK1r27AT-00fAPa; Mon, 06 Feb 2023 21:56:14 +0100 Content-Language: en-US In-Reply-To: <87ttzybq3m.fsf@gnu.org> X-Provags-ID: V03:K1:CShU8o4HM0VRrmhqzRQbKGVYISK+3vhz4xP2yAx7IUDmAmoGbu2 ZA9EluYHIcDik+CsMjGcabAexWmQpu2x6Le3L44QLWIahqzZrznnedxhKwNCCHL8PUptVQh sDNhrPx89AX3EbDE/d/XWk/WwiWdA+RL9dMDORba8BZvaTJA+L2b9883a/Ltxbu4K6sFmJu 6k2U66vvMcZse4f2H+sLw== UI-OutboundReport: notjunk:1;M01:P0:l6mMGS5iioA=;cN9/JJorZT67QBLyruO1y3yB5u9 aDc0jMuDFbLmUrMBHo/kkVSbolFz//NcFdnxoMGWeZh5IaD+lZIdHxJS31+Z+Yn4pNb/05IPj Vwff9mnYcmHgfXKvVcnaWQTTExwLCmdoGous0Kwwpsbr5RiYgL+TxpUkeUlEKigMoNDwR+tAv pkDzIontPC2X0inIU8Hy6qNEx38cGEBzzDc7h/5mDvH+Q3DSblRRlmLRkX7Z+QFHGVgXwzvIH KLgSNBAFeSAcJXEpUNiluX2qYleaLjv6oelGjCwFSBG1wJXNx1cF8t0rRkAKuiLUJj2F25uda F58bt6yyBDreaYPPlIpYRtMIsG6DnvQP/HhxF+4pjkFo8Iqxal/k5/fQ74s/9dt/AsHM4yVDD gAYRn9GxrmmiaW+1vz24bTzNTpoGJ+p4HCd86JADowhT2UaeFzbIzW00Bh3/1w7ak7xuTXBgz oqi8ZB3XFF18QkFuwUL209hopPNQY7Pg3q0HPB8zch7mckCjL8QvJSH5QXAWsRQoVW/xB+0jM KLocSg8KXdF3db4kwnitFHLAHbUYAGGIPZcq7n+Y1QpDORWU9iMHDcL2qOIN1juPcnG5G7TzZ ajjq/9wc55mvwBqFU1fWIc6MDl5bg/EuzHEfS5wf+r4kLYTumW5Kn53FVgJbuZC3sQTilthT/ cJlYSQOBACwrSbSsU2ljDrLkZXpB1VffEKBeswQ38w== Received-SPF: pass client-ip=212.227.17.13; envelope-from=jean@abou-samra.fr; helo=mout.kundenserver.de X-Spam_score_int: -29 X-Spam_score: -3.0 X-Spam_bar: --- X-Spam_report: (-3.0 / 5.0 requ) BAYES_00=-1.9, NICE_REPLY_A=-1.148, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action 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:21690 Archived-At: This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --------------IWTvk80EVSGXcuBeXUkvfYFx Content-Type: multipart/mixed; boundary="------------zrYjuR7lJK9Uc9sLEbHkworf"; protected-headers="v1" From: Jean Abou Samra To: "Jose E. Marchesi" , guile-devel@gnu.org Cc: ludo@gnu.org Message-ID: <29bad7bd-fad4-c835-cad9-488462efbe4f@abou-samra.fr> Subject: Re: [RFC,PATCH] Do not GC_INIT the Boehm GC if already initialized References: <87ttzybq3m.fsf@gnu.org> In-Reply-To: <87ttzybq3m.fsf@gnu.org> --------------zrYjuR7lJK9Uc9sLEbHkworf Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On 06/02/2023 19:34, Jose E. Marchesi wrote: >=20 > Hello Guile hackers. >=20 > We are in the process of integrating GNU poke[1] in GDB by mean of > libpoke. >=20 > Problem is, libpoke uses the Boehm GC, as guile does. We are working o= n > switching to an ad-hoc exact collector, but it will get some time. >=20 > So, in the interim, we may: >=20 > 1) Make both libguile and libpoke to do GC_INIT conditionally, only if > no one else has initialized the collector before. This is already i= n > poke master. A suggested (untested!) patch for guile below. >=20 > 2) Test to see if the collector works properly. >=20 > 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. >=20 > Does this sound like a plan? > Thanks in advance! >=20 > [1] https://jemarch.net/poke >=20 > 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 > =20 > - GC_INIT (); > + if(!GC_is_init_called ()) > + GC_INIT (); > =20 > size_t heap_size =3D GC_get_heap_size (); > if (heap_size < DEFAULT_INITIAL_HEAP_SIZE) >=20 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. --------------zrYjuR7lJK9Uc9sLEbHkworf-- --------------IWTvk80EVSGXcuBeXUkvfYFx Content-Type: application/pgp-signature; name="OpenPGP_signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="OpenPGP_signature" -----BEGIN PGP SIGNATURE----- wnsEABYIACMWIQSZ7TKxnKGyBvBjzBmj8PYLiTOX/gUCY+FpbQUDAAAAAAAKCRCj8PYLiTOX/hzs AQCR4qndcZeg/YPj3yCH9nX2ByRnwPFAI8lg3Y9NSHX5OwEAgCmu+8c65K1bN90gSwstfvsELw5z FfpNfnvwMfNFIQk= =KO/J -----END PGP SIGNATURE----- --------------IWTvk80EVSGXcuBeXUkvfYFx--