Skip to content
This repository was archived by the owner on Oct 12, 2022. It is now read-only.

Commit 05503bd

Browse files
committed
register precise GC
1 parent f056eeb commit 05503bd

File tree

1 file changed

+12
-0
lines changed
  • src/gc/impl/conservative

1 file changed

+12
-0
lines changed

src/gc/impl/conservative/gc.d

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,12 @@ extern(C) pragma(crt_constructor) void _d_register_conservative_gc()
110110
registerGCFactory("conservative", &initialize);
111111
}
112112

113+
extern(C) pragma(crt_constructor) void _d_register_precise_gc()
114+
{
115+
import gc.registry;
116+
registerGCFactory("precise", &initialize_precise);
117+
}
118+
113119
private GC initialize()
114120
{
115121
import core.stdc.string: memcpy;
@@ -127,6 +133,12 @@ private GC initialize()
127133
return instance;
128134
}
129135

136+
private GC initialize_precise()
137+
{
138+
ConservativeGC.isPrecise = true;
139+
return initialize();
140+
}
141+
130142
class ConservativeGC : GC
131143
{
132144
// For passing to debug code (not thread safe)

0 commit comments

Comments
 (0)