X-Git-Url: https://git.llucax.com/software/dgc/cdgc.git/blobdiff_plain/624a6db4949f3e3a7ebba7506166e0f9d4be3e5e..6a3232d8f1c52377e792b4f4e18fd75f2a3b0f60:/rt/gc/cdgc/iface.d diff --git a/rt/gc/cdgc/iface.d b/rt/gc/cdgc/iface.d index 703bbef..3002284 100644 --- a/rt/gc/cdgc/iface.d +++ b/rt/gc/cdgc/iface.d @@ -28,7 +28,8 @@ module rt.gc.cdgc.iface; import rt.gc.cdgc.gc: GC, BlkInfo; import rt.gc.cdgc.stats: GCStats; -import libc = rt.gc.cdgc.libc; + +import cstdlib = tango.stdc.stdlib; version=GCCLASS; @@ -66,13 +67,13 @@ extern (C) void gc_init() version (GCCLASS) { ClassInfo ci = GC.classinfo; - void* p = libc.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*) libc.calloc(1, GC.sizeof); + _gc = cast(GC*) cstdlib.calloc(1, GC.sizeof); } _gc.initialize(); version (DigitalMars) version(OSX) { @@ -101,10 +102,9 @@ 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(); + _gc.fullCollect(); } } @@ -144,19 +144,22 @@ extern (C) uint gc_clrAttr( void* p, uint a ) return _gc.clrAttr( p, a ); } -extern (C) void* gc_malloc( size_t sz, uint ba = 0 ) +extern (C) void* gc_malloc(size_t sz, uint attrs = 0, + PointerMap ptrmap = PointerMap.init) { - return _gc.malloc( sz, ba ); + return _gc.malloc(sz, attrs, ptrmap); } -extern (C) void* gc_calloc( size_t sz, uint ba = 0 ) +extern (C) void* gc_calloc(size_t sz, uint attrs = 0, + PointerMap ptrmap = PointerMap.init) { - return _gc.calloc( sz, ba ); + return _gc.calloc(sz, attrs, ptrmap); } -extern (C) void* gc_realloc( void* p, size_t sz, uint ba = 0 ) +extern (C) void* gc_realloc(void* p, size_t sz, uint attrs = 0, + PointerMap ptrmap = PointerMap.init) { - return _gc.realloc( p, sz, ba ); + return _gc.realloc(p, sz, attrs, ptrmap); } extern (C) size_t gc_extend( void* p, size_t mx, size_t sz ) @@ -232,3 +235,6 @@ extern (C) Object gc_weakpointerGet( void* wp ) { return _gc.weakpointerGet(wp); } + + +// vim: set et sw=4 sts=4 :