guile-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [RFC,PATCH] Do not GC_INIT the Boehm GC if already initialized


From: Jean Abou Samra
Subject: Re: [RFC,PATCH] Do not GC_INIT the Boehm GC if already initialized
Date: Mon, 6 Feb 2023 21:56:13 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.6.0

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.


Attachment: OpenPGP_signature
Description: OpenPGP digital signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]