[trunk r143197] patch adding optional extra marking to GGC

Basile STARYNKEVITCH basile@starynkevitch.net
Fri Jan 9 10:20:00 GMT 2009


Hello All

The attached patch is a very small improvement. The code change is 
minuscule. 

The idea is to add, for some peculiar users (I am explicitly thinking of 
future plugin facilities), the ability to invoke a marking routine on 
some data during GGC collection.
The implementation is straightforward. The collector internally calls 
the extra provided marking routine (if it is not null) after having 
marked roots. The old behavior is kept when no marking routine is 
provided (ie it is a null pointer).

Most of the patch is comments & documentation. I also documented briefly 
(in *.texi form) the usual ggc_collect routine which does not seem to be 
documented yet, and the newly available ggc_collect_extra_marking routine.

I don't know in which kind of stage this small patch fits in. It provide 
a small extra internal functionality trivially implemented. This 
functionality is not actively used yet here in the trunk (but the MELT 
branch has effectively used it for many months without issues).

Bootstrapped on x86-64-linux with --enable-languages c,c++ and 
--disable-multilib


Changelog is:
2009-01-08  Basile Starynkevitch  <basile@starynkevitch.net>
    * doc/gty.texi: Added documentation of ggc_collect and
    ggc_collect_extra_marking.
    * gcc/ggc.h: Updated copyright year.
    (ggc_mark_roots_extra_marking) added declaration.
    * gcc/ggc-common.c: Updated copyright year.
    (ggc_mark_roots): Becomes just a wrapper.
    (ggc_mark_root_extra_marking) New function, doing what former
    ggc_mark_roots did and also call the provided extramarker on the
    provided data if not null.
    * ggc/ggc-zone.c: Updated copyright year.
    (ggc_collect_1) Added extra marking arguments and uses them.
    * ggc/ggc-page.c: Updated copyright year.
    (ggc_collect) Renamed as ggc_collect_extra_marking and make the
    extra marking.
    (ggc_collect_extra_marking) Added.



Comments are welcome. Ok for trunk?

Happy new year 2009 to everyone.

Regards.

-- 
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 mines, sont seulement les miennes} ***
membre de l'APRIL "promouvoir et défendre le logiciel libre"
Rejoignez maitenant pplus de 3700 adhérents http://www.april.org

-------------- next part --------------
A non-text attachment was scrubbed...
Name: gcc-extra-marking-patch-r143197.diff
Type: text/x-patch
Size: 8657 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20090109/abf339ca/attachment.bin>


More information about the Gcc-patches mailing list