diff options
Diffstat (limited to 'gcc/doc')
-rw-r--r-- | gcc/doc/gty.texi | 8 | ||||
-rw-r--r-- | gcc/doc/plugins.texi | 10 |
2 files changed, 14 insertions, 4 deletions
diff --git a/gcc/doc/gty.texi b/gcc/doc/gty.texi index ef7a5d42fdb..b59d5f3d35e 100644 --- a/gcc/doc/gty.texi +++ b/gcc/doc/gty.texi @@ -450,6 +450,14 @@ For language frontends, there is another file that needs to be included somewhere. It will be called @file{gtype-@var{lang}.h}, where @var{lang} is the name of the subdirectory the language is contained in. +Plugins can add additional root tables. Run the @code{gengtype} +utility in plugin mode as @code{gengtype -p @var{source-dir} +@var{file-list} @var{plugin*.c}} with your plugin files +@var{plugin*.c} using @code{GTY} to generate the corresponding +@var{gt-plugin*.h} files. The GCC build tree is needed to be present in +that mode. + + @node Invoking the garbage collector @section How to invoke the garbage collector @cindex garbage collector, invocation diff --git a/gcc/doc/plugins.texi b/gcc/doc/plugins.texi index 287619c404d..f02f931b102 100644 --- a/gcc/doc/plugins.texi +++ b/gcc/doc/plugins.texi @@ -198,13 +198,15 @@ Some plugins may need to have GGC mark additional data. This can be done by registering a callback (called with a null @code{gcc_data}) for the @code{PLUGIN_GGC_MARKING} event. Such callbacks can call the @code{ggc_set_mark} routine, preferably thru the @code{ggc_mark} macro -(and conversly, these routines should usually not be used in plugins -outside of the @code{PLUGIN_GGC_MARKING} event). +(and conversely, these routines should usually not be used in plugins +outside of the @code{PLUGIN_GGC_MARKING} event). Some plugins may need to add extra GGC root tables, e.g. to handle their own @code{GTY}-ed data. This can be done with the -@code{PLUGIN_REGISTER_GGC_ROOTS} pseudo-event with a null callback and the -extra root table as @code{user_data}. +@code{PLUGIN_REGISTER_GGC_ROOTS} pseudo-event with a null callback and +the extra root table as @code{user_data}. Running the @code{gengtype +-p @var{source-dir} @var{file-list} @var{plugin*.c} ...} utility +generates this extra root table. You should understand the details of memory management inside GCC before using @code{PLUGIN_GGC_MARKING} or |