xref: /netbsd-src/external/gpl3/gcc/dist/libphobos/libdruntime/rt/memory.d (revision b1e838363e3c6fc78a55519254d99869742dd33c)
1 /**
2  * This module tells the garbage collector about the static data and bss segments,
3  * so the GC can scan them for roots. It does not deal with thread local static data.
4  *
5  * Copyright: Copyright Digital Mars 2000 - 2012.
6  * License: Distributed under the
7  *      $(LINK2 http://www.boost.org/LICENSE_1_0.txt, Boost Software License 1.0).
8  *    (See accompanying file LICENSE)
9  * Authors:   Walter Bright, Sean Kelly
10  * Source: $(DRUNTIMESRC rt/_memory.d)
11  */
12 
13 module rt.memory;
14 
15 
16 import core.memory;
17 import rt.sections;
18 
initStaticDataGC()19 void initStaticDataGC()
20 {
21     foreach (ref sg; SectionGroup)
22     {
23         foreach (rng; sg.gcRanges)
24             GC.addRange(rng.ptr, rng.length);
25     }
26 }
27