X-Git-Url: https://git.llucax.com/software/dgc/cdgc.git/blobdiff_plain/004b7e95d7c07045ff197463abf3eab1e9d353ac..11b7fc5cdb1df190c6c434fea14a00e700721fbc:/rt/gc/cdgc/iface.d diff --git a/rt/gc/cdgc/iface.d b/rt/gc/cdgc/iface.d index 7f78437..fec035a 100644 --- a/rt/gc/cdgc/iface.d +++ b/rt/gc/cdgc/iface.d @@ -26,9 +26,10 @@ module rt.gc.cdgc.iface; -import rt.gc.cdgc.gc; -import rt.gc.cdgc.stats; -import rt.gc.cdgc.libc; +import rt.gc.cdgc.gc: GC, BlkInfo; +import rt.gc.cdgc.stats: GCStats; + +import cstdlib = tango.stdc.stdlib; version=GCCLASS; @@ -64,16 +65,15 @@ extern (C) void thread_init(); extern (C) void gc_init() { version (GCCLASS) - { void* p; + { ClassInfo ci = GC.classinfo; - - p = malloc(ci.init.length); + void* p = cstdlib.malloc(ci.init.length); (cast(byte*)p)[0 .. ci.init.length] = ci.init[]; _gc = cast(GC)p; } else { - _gc = cast(GC*) calloc(1, GC.sizeof); + _gc = cast(GC*) cstdlib.calloc(1, GC.sizeof); } _gc.initialize(); version (DigitalMars) version(OSX) { @@ -102,7 +102,6 @@ extern (C) void gc_term() // _gc.fullCollectNoStack(); // not really a 'collect all' -- still scans // static data area, roots, and ranges. - _gc.Dtor(); } else { // default (safe) clenup _gc.fullCollect(); @@ -233,3 +232,6 @@ extern (C) Object gc_weakpointerGet( void* wp ) { return _gc.weakpointerGet(wp); } + + +// vim: set et sw=4 sts=4 :