X-Git-Url: https://git.llucax.com/software/dgc/cdgc.git/blobdiff_plain/2b1e1065120ee46e3f4331f1827cc2b3e1fe175d..2ede6aa954704e0e386f99a6d88364f60dcf5107:/rt/gc/cdgc/bits.d?ds=sidebyside diff --git a/rt/gc/cdgc/bits.d b/rt/gc/cdgc/bits.d index 275beb6..02300ce 100644 --- a/rt/gc/cdgc/bits.d +++ b/rt/gc/cdgc/bits.d @@ -26,7 +26,8 @@ module rt.gc.cdgc.bits; -import rt.gc.cdgc.libc; +import cstdlib = tango.stdc.stdlib; +import cstring = tango.stdc.string; private extern (C) void onOutOfMemoryError(); @@ -63,7 +64,7 @@ struct GCBits { if (data) { - free(data); + cstdlib.free(data); data = null; } } @@ -80,7 +81,7 @@ struct GCBits { this.nbits = nbits; nwords = (nbits + (BITS_PER_WORD - 1)) >> BITS_SHIFT; - data = cast(uint*)calloc(nwords + 2, uint.sizeof); + data = cast(uint*)cstdlib.calloc(nwords + 2, uint.sizeof); if (!data) onOutOfMemoryError(); } @@ -137,14 +138,13 @@ struct GCBits } } else - { uint result; - + { //result = (cast(bit *)(data + 1))[i]; //(cast(bit *)(data + 1))[i] = 0; uint* p = &data[1 + (i >> BITS_SHIFT)]; uint mask = (1 << (i & BITS_MASK)); - result = *p & mask; + uint result = *p & mask; *p &= ~mask; return result; } @@ -157,7 +157,7 @@ struct GCBits for (;d1!=dEnd;++d1) *d1=0u; } else { - memset(data + 1, 0, nwords * uint.sizeof); + cstring.memset(data + 1, 0, nwords * uint.sizeof); } } @@ -173,7 +173,7 @@ struct GCBits for (;d1!=dEnd;++d1,++d2) *d1=*d2; } else { - memcpy(data + 1, f.data + 1, nwords * uint.sizeof); + cstring.memcpy(data + 1, f.data + 1, nwords * uint.sizeof); } } @@ -217,3 +217,6 @@ unittest b.Dtor(); } + + +// vim: set et sw=4 sts=4 :