This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

PATCH.DOC: gty.texi - explanation


Hello

I found (the hard way) that when a new source file gcc/mypass.c has
only a struct GTY which is not used (no variables yet of this type),
the gengtype machinery does not generate the gt-mypass.h file.

I'm not able to correct the gengtype code for this, but I am
suggesting the following patch (to rev 119443 of gcc trunk) -
changelog and patch is after my signature.

Regards
-- 
Basile STARYNKEVITCH         http://starynkevitch.net/Basile/ 
email: basile<at>starynkevitch<dot>net mobile: +33 6 8501 2359 
8, rue de la Faïencerie, 92340 Bourg La Reine, France
*** opinions {are only mines, sont seulement les miennes} ***


gcc/Changelog:

2006-12-01  Basile Starynkevitch  <basile@starynkevitch.net>
	* doc/gty.texi added more explanation about the garbage 
	  collector.

Index: gcc/doc/gty.texi
===================================================================
--- gcc/doc/gty.texi	(revision 119443)
+++ gcc/doc/gty.texi	(working copy)
@@ -65,6 +65,17 @@
 @code{typedef int @var{name};}.
 These don't need to be marked.
 
+The garbage collector inside GCC is a precise mark and sweep garbage
+collector@footnote{This is the default collector, unless configured
+otherwise}.  It follows only explicitly marked (with @code{GTY(())})
+static or global GCC variables, and does not follow any local pointers
+on the compiler's call stack.  The collector is explicitly called by
+calls to @code{ggc_collect} and is not called implicitly by
+allocators.  Every @code{struct} and variable marked with
+@code{GTY(())} should really be used.  For instance, GCC contributors
+should avoid declaring a @code{struct @var{tag} GTY(())} like above
+without using it (in fields or variables).
+
 @menu
 * GTY Options::		What goes inside a @code{GTY(())}.
 * GGC Roots::		Making global variables GGC roots.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]