This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Plugins & GGC ie GTY
- From: Richard Guenther <richard dot guenther at gmail dot com>
- To: Basile STARYNKEVITCH <basile at starynkevitch dot net>
- Cc: Taras Glek <tglek at mozilla dot com>, "Joseph S. Myers" <joseph at codesourcery dot com>, GCC Mailing List <gcc at gcc dot gnu dot org>, Diego Novillo <dnovillo at google dot com>, Le-Chun Wu <lcwu at google dot com>, Grigori Fursin <grigori dot fursin at inria dot fr>
- Date: Wed, 1 Apr 2009 20:26:06 +0200
- Subject: Re: Plugins & GGC ie GTY
- References: <49D25E40.6080507@mozilla.com> <84fc9c000904010146j53e49ed9i6c271751d41dfd42@mail.gmail.com> <Pine.LNX.4.64.0904011257550.14922@digraph.polyomino.org.uk> <49D398C9.1010809@mozilla.com> <49D3A2CA.7030603@starynkevitch.net>
On Wed, Apr 1, 2009 at 7:22 PM, Basile STARYNKEVITCH
<basile@starynkevitch.net> wrote:
>
> Hello All,
>
> [I don't know if this discussion belongs to gcc@ or gcc-patches@ so I'm
> sending it on gcc@ since I don't propose or discuss any code yet]
>
> My understanding was that most plugins people are aware that somehow some
> plugins would need to have static GTY-ed roots for the GGC machinery.
>
> So it seems to me that we'll need :
>
> 1. The ability to run gengtype in a special mode for plugins, on the source
> code of the plugin. to generate the gt-*.h files included by the source code
> of the plugin. This would require a patch to gengtype.
>
> 2. The ability to handle, very probably using dlsym, or perhaps by having a
> gcc_plugin_register_gty_table function called from the plugin initialization
> routine, to plug the generated root tables (an array of struct ggc_root_tab,
> which is defined in the generated gt-*.h files) of the plugin into the GGC
> machinery. This would require a short patch to ggc-common.c or similar
> ggc-*.c files.
>
> Did I miss anything?
Plugins shouldn't keep permanent references to GCed memory. At least
that would make it unnecessary to do what you suggest.
Richard.