]> git.ipfire.org Git - thirdparty/gcc.git/blame - gcc/doc/gccint/memory-management-and-type-information/marking-roots-for-the-garbage-collector.rst
sphinx: add missing trailing newline
[thirdparty/gcc.git] / gcc / doc / gccint / memory-management-and-type-information / marking-roots-for-the-garbage-collector.rst
CommitLineData
c63539ff
ML
1..
2 Copyright 1988-2022 Free Software Foundation, Inc.
3 This is part of the GCC manual.
4 For copying conditions, see the copyright.rst file.
5
6.. index:: roots, marking, marking roots
7
8.. _ggc-roots:
9
10Marking Roots for the Garbage Collector
11***************************************
12
13In addition to keeping track of types, the type machinery also locates
14the global variables (:dfn:`roots`) that the garbage collector starts
15at. Roots must be declared using one of the following syntaxes:
16
17* ``extern GTY(([options])) typename;``
18
19* ``static GTY(([options])) typename;``
20
21The syntax
22
23* ``GTY(([options])) typename;``
24
25is *not* accepted. There should be an ``extern`` declaration
26of such a variable in a header somewhere---mark that, not the
27definition. Or, if the variable is only used in one file, make it
3ed1b4ce 28``static``.