]> git.llucax.com Git - software/druntime.git/blobdiff - src/gc/basic/gcx.d
restored support for setting gc handle
[software/druntime.git] / src / gc / basic / gcx.d
index 5145839290b1e341132c8ae51dd1072a6169e579..c4a46c9a6b8e0022752b3f1b2d06b7b4a2c6d489 100644 (file)
@@ -86,6 +86,8 @@ private
 
     extern (C) void* rt_stackBottom();
     extern (C) void* rt_stackTop();
+    extern (C) void* rt_staticDataBottom();
+    extern (C) void* rt_staticDataTop();
 
     extern (C) void rt_finalize( void* p, bool det = true );
 
@@ -1124,6 +1126,21 @@ class GC
     }
 
 
+    static void scanStaticData(gc_t g)
+    {
+        //debug(PRINTF) printf("+GC.scanStaticData()\n");
+        auto pbot = rt_staticDataBottom();
+        auto ptop = rt_staticDataTop();
+        g.addRange(pbot, ptop - pbot);
+        //debug(PRINTF) printf("-GC.scanStaticData()\n");
+    }
+
+    static void unscanStaticData(gc_t g)
+    {
+        auto pbot = rt_staticDataBottom();
+        g.removeRange(pbot);
+    }
+
     /**
      * add p to list of roots
      */