On Wed, 22 Jun 2011 08:19:17 +0200 Jakub Jelinek <ja...@redhat.com> wrote:
> You could just: > #include "ggc.h" > > static void my_walker (void *arg ATTRIBUTE_UNUSED) > { > /* Ignore argument, as it is dummy */ > /* Walk all the still live python objects here and if they reference > GCC GC objects, call > ggc_test_and_set_mark (ptr); > on each of them. */ > } > > static struct ggc_root_tab myroot = { "", 1, 1, my_walker, NULL }; > > ... > init_plugin (...) > { > ... > ggc_register_root_tab (&myroot); > ... Perhaps a simpler alternative might be to use the PLUGIN_GGC_MARKING event, it was designed for such use (and MELT actively uses it). Cheers -- Basile STARYNKEVITCH http://starynkevitch.net/Basile/ email: basile<at>starynkevitch<dot>net mobile: +33 6 8501 2359 8, rue de la Faiencerie, 92340 Bourg La Reine, France *** opinions {are only mine, sont seulement les miennes} ***