]> git.llucax.com Git - software/dgc/cdgc.git/commitdiff
Use tango bindings to C standard library functions
authorLeandro Lucarella <llucax@gmail.com>
Wed, 9 Jun 2010 22:41:47 +0000 (19:41 -0300)
committerLeandro Lucarella <llucax@gmail.com>
Wed, 9 Jun 2010 22:49:56 +0000 (19:49 -0300)
As we need to use more libraries it became less practical to maintain our
own set of bindings, and since the GC only works with Tango, it makes
sense to just use Tango bindings.

rt/gc/cdgc/bits.d
rt/gc/cdgc/gc.d
rt/gc/cdgc/iface.d
rt/gc/cdgc/libc.d [deleted file]

index a2e5e0dd145a65f4b35a4630caadccdf0bfb6a38..520b780bda51c7cb639e5388833b276c5887d6d5 100644 (file)
@@ -26,7 +26,8 @@
 
 module rt.gc.cdgc.bits;
 
 
 module rt.gc.cdgc.bits;
 
-import libc = rt.gc.cdgc.libc;
+import cstdlib = tango.stdc.stdlib;
+import cstring = tango.stdc.string;
 
 private extern (C) void onOutOfMemoryError();
 
 
 private extern (C) void onOutOfMemoryError();
 
@@ -63,7 +64,7 @@ struct GCBits
     {
         if (data)
         {
     {
         if (data)
         {
-            libc.free(data);
+            cstdlib.free(data);
             data = null;
         }
     }
             data = null;
         }
     }
@@ -80,7 +81,7 @@ struct GCBits
     {
         this.nbits = nbits;
         nwords = (nbits + (BITS_PER_WORD - 1)) >> BITS_SHIFT;
     {
         this.nbits = nbits;
         nwords = (nbits + (BITS_PER_WORD - 1)) >> BITS_SHIFT;
-        data = cast(uint*)libc.calloc(nwords + 2, uint.sizeof);
+        data = cast(uint*)cstdlib.calloc(nwords + 2, uint.sizeof);
         if (!data)
             onOutOfMemoryError();
     }
         if (!data)
             onOutOfMemoryError();
     }
@@ -156,7 +157,7 @@ struct GCBits
             for (;d1!=dEnd;++d1)
                 *d1=0u;
         } else {
             for (;d1!=dEnd;++d1)
                 *d1=0u;
         } else {
-            libc.memset(data + 1, 0, nwords * uint.sizeof);
+            cstring.memset(data + 1, 0, nwords * uint.sizeof);
         }
     }
 
         }
     }
 
@@ -172,7 +173,7 @@ struct GCBits
             for (;d1!=dEnd;++d1,++d2)
                 *d1=*d2;
         } else {
             for (;d1!=dEnd;++d1,++d2)
                 *d1=*d2;
         } else {
-            libc.memcpy(data + 1, f.data + 1, nwords * uint.sizeof);
+            cstring.memcpy(data + 1, f.data + 1, nwords * uint.sizeof);
         }
     }
 
         }
     }
 
index ca30f56262d04a379ca12cb8436fbdf2744eed4d..16fcbca9e01b53554ed986ecf4880927fae067fe 100644 (file)
@@ -48,7 +48,9 @@ version = STACKGROWSDOWN;       // growing the stack means subtracting from the
 import rt.gc.cdgc.bits: GCBits;
 import rt.gc.cdgc.stats: GCStats;
 import alloc = rt.gc.cdgc.alloc;
 import rt.gc.cdgc.bits: GCBits;
 import rt.gc.cdgc.stats: GCStats;
 import alloc = rt.gc.cdgc.alloc;
-import libc = rt.gc.cdgc.libc;
+
+import cstdlib = tango.stdc.stdlib;
+import cstring = tango.stdc.string;
 
 
 version (GNU)
 
 
 version (GNU)
@@ -144,7 +146,7 @@ debug (LOGGING)
         void Dtor()
         {
             if (data)
         void Dtor()
         {
             if (data)
-                libc.free(data);
+                cstdlib.free(data);
             data = null;
         }
 
             data = null;
         }
 
@@ -157,18 +159,18 @@ debug (LOGGING)
                 assert(dim + nentries <= allocdim);
                 if (!data)
                 {
                 assert(dim + nentries <= allocdim);
                 if (!data)
                 {
-                    data = cast(Log*) libc.malloc(allocdim * Log.sizeof);
+                    data = cast(Log*) cstdlib.malloc(allocdim * Log.sizeof);
                     if (!data && allocdim)
                         onOutOfMemoryError();
                 }
                 else
                 {
                     if (!data && allocdim)
                         onOutOfMemoryError();
                 }
                 else
                 {
-                    Log *newdata = cast(Log*) libc.malloc(
+                    Log *newdata = cast(Log*) cstdlib.malloc(
                             allocdim * Log.sizeof);
                     if (!newdata && allocdim)
                         onOutOfMemoryError();
                             allocdim * Log.sizeof);
                     if (!newdata && allocdim)
                         onOutOfMemoryError();
-                    libc.memcpy(newdata, data, dim * Log.sizeof);
-                    libc.free(data);
+                    cstring.memcpy(newdata, data, dim * Log.sizeof);
+                    cstdlib.free(data);
                     data = newdata;
                 }
             }
                     data = newdata;
                 }
             }
@@ -183,7 +185,7 @@ debug (LOGGING)
 
         void remove(size_t i)
         {
 
         void remove(size_t i)
         {
-            libc.memmove(data + i, data + i + 1, (dim - i) * Log.sizeof);
+            cstring.memmove(data + i, data + i + 1, (dim - i) * Log.sizeof);
             dim--;
         }
 
             dim--;
         }
 
@@ -203,7 +205,7 @@ debug (LOGGING)
         {
             reserve(from.dim - dim);
             assert(from.dim <= allocdim);
         {
             reserve(from.dim - dim);
             assert(from.dim <= allocdim);
-            libc.memcpy(data, from.data, from.dim * Log.sizeof);
+            cstring.memcpy(data, from.data, from.dim * Log.sizeof);
             dim = from.dim;
         }
     }
             dim = from.dim;
         }
     }
@@ -234,7 +236,7 @@ class GC
     void initialize()
     {
         gcLock = GCLock.classinfo;
     void initialize()
     {
         gcLock = GCLock.classinfo;
-        gcx = cast(Gcx*) libc.calloc(1, Gcx.sizeof);
+        gcx = cast(Gcx*) cstdlib.calloc(1, Gcx.sizeof);
         if (!gcx)
             onOutOfMemoryError();
         gcx.initialize();
         if (!gcx)
             onOutOfMemoryError();
         gcx.initialize();
@@ -247,7 +249,7 @@ class GC
         if (gcx)
         {
             gcx.Dtor();
         if (gcx)
         {
             gcx.Dtor();
-            libc.free(gcx);
+            cstdlib.free(gcx);
             gcx = null;
         }
     }
             gcx = null;
         }
     }
@@ -478,8 +480,8 @@ class GC
             // Return next item from free list
             gcx.bucket[bin] = (cast(List*)p).next;
             if( !(bits & BlkAttr.NO_SCAN) )
             // Return next item from free list
             gcx.bucket[bin] = (cast(List*)p).next;
             if( !(bits & BlkAttr.NO_SCAN) )
-                libc.memset(p + size, 0, binsize[bin] - size);
-            debug (MEMSTOMP) libc.memset(p, 0xF0, size);
+                cstring.memset(p + size, 0, binsize[bin] - size);
+            debug (MEMSTOMP) cstring.memset(p, 0xF0, size);
         }
         else
         {
         }
         else
         {
@@ -532,7 +534,7 @@ class GC
         assert(size != 0);
 
         void *p = mallocNoSync(size, bits);
         assert(size != 0);
 
         void *p = mallocNoSync(size, bits);
-        libc.memset(p, 0, size);
+        cstring.memset(p, 0, size);
         return p;
     }
 
         return p;
     }
 
@@ -603,7 +605,7 @@ class GC
                     p2 = mallocNoSync(size, bits);
                     if (psize < size)
                         size = psize;
                     p2 = mallocNoSync(size, bits);
                     if (psize < size)
                         size = psize;
-                    libc.memcpy(p2, p, size);
+                    cstring.memcpy(p2, p, size);
                     p = p2;
                 }
             }
                     p = p2;
                 }
             }
@@ -626,7 +628,7 @@ class GC
                         synchronized (gcLock)
                         {
                             debug (MEMSTOMP)
                         synchronized (gcLock)
                         {
                             debug (MEMSTOMP)
-                                libc.memset(p + size, 0xF2, psize - size);
+                                cstring.memset(p + size, 0xF2, psize - size);
                             pool.freePages(pagenum + newsz, psz - newsz);
                         }
                         return p;
                             pool.freePages(pagenum + newsz, psz - newsz);
                         }
                         return p;
@@ -641,10 +643,10 @@ class GC
                                 if (i == pagenum + newsz)
                                 {
                                     debug (MEMSTOMP)
                                 if (i == pagenum + newsz)
                                 {
                                     debug (MEMSTOMP)
-                                        libc.memset(p + psize, 0xF0,
+                                        cstring.memset(p + psize, 0xF0,
                                                 size - psize);
                                                 size - psize);
-                                    libc.memset(&pool.pagetable[pagenum + psz],
-                                            B_PAGEPLUS, newsz - psz);
+                                    cstring.memset(pool.pagetable + pagenum +
+                                            psz, B_PAGEPLUS, newsz - psz);
                                     return p;
                                 }
                                 if (i == pool.npages)
                                     return p;
                                 }
                                 if (i == pool.npages)
@@ -683,7 +685,7 @@ class GC
                     p2 = mallocNoSync(size, bits);
                     if (psize < size)
                         size = psize;
                     p2 = mallocNoSync(size, bits);
                     if (psize < size)
                         size = psize;
-                    libc.memcpy(p2, p, size);
+                    cstring.memcpy(p2, p, size);
                     p = p2;
                 }
             }
                     p = p2;
                 }
             }
@@ -755,8 +757,8 @@ class GC
         if (sz < minsz)
             return 0;
         debug (MEMSTOMP)
         if (sz < minsz)
             return 0;
         debug (MEMSTOMP)
-            libc.memset(p + psize, 0xF0, (psz + sz) * PAGESIZE - psize);
-        libc.memset(pool.pagetable + pagenum + psz, B_PAGEPLUS, sz);
+            cstring.memset(p + psize, 0xF0, (psz + sz) * PAGESIZE - psize);
+        cstring.memset(pool.pagetable + pagenum + psz, B_PAGEPLUS, sz);
         gcx.p_cache = null;
         gcx.size_cache = 0;
         return (psz + sz) * PAGESIZE;
         gcx.p_cache = null;
         gcx.size_cache = 0;
         return (psz + sz) * PAGESIZE;
@@ -847,7 +849,7 @@ class GC
             size_t n = pagenum;
             while (++n < pool.npages && pool.pagetable[n] == B_PAGEPLUS)
                 npages++;
             size_t n = pagenum;
             while (++n < pool.npages && pool.pagetable[n] == B_PAGEPLUS)
                 npages++;
-            debug (MEMSTOMP) libc.memset(p, 0xF2, npages * PAGESIZE);
+            debug (MEMSTOMP) cstring.memset(p, 0xF2, npages * PAGESIZE);
             pool.freePages(pagenum, npages);
         }
         else
             pool.freePages(pagenum, npages);
         }
         else
@@ -855,7 +857,7 @@ class GC
             // Add to free list
             List *list = cast(List*)p;
 
             // Add to free list
             List *list = cast(List*)p;
 
-            debug (MEMSTOMP) libc.memset(p, 0xF2, binsize[bin]);
+            debug (MEMSTOMP) cstring.memset(p, 0xF2, binsize[bin]);
 
             list.next = gcx.bucket[bin];
             gcx.bucket[bin] = list;
 
             list.next = gcx.bucket[bin];
             gcx.bucket[bin] = list;
@@ -1263,7 +1265,7 @@ class GC
         size_t n;
         size_t bsize = 0;
 
         size_t n;
         size_t bsize = 0;
 
-        libc.memset(&stats, 0, GCStats.sizeof);
+        cstring.memset(&stats, 0, GCStats.sizeof);
 
         for (n = 0; n < gcx.npools; n++)
         {
 
         for (n = 0; n < gcx.npools; n++)
         {
@@ -1331,7 +1333,7 @@ class GC
             // 1. to hide the reference from the GC
             // 2. the GC doesn't scan delegates added by rt_attachDisposeEvent
             //    for references
             // 1. to hide the reference from the GC
             // 2. the GC doesn't scan delegates added by rt_attachDisposeEvent
             //    for references
-            auto wp = cast(WeakPointer*)(libc.malloc(WeakPointer.sizeof));
+            auto wp = cast(WeakPointer*)(cstdlib.malloc(WeakPointer.sizeof));
             if (!wp)
                 onOutOfMemoryError();
             wp.reference = r;
             if (!wp)
                 onOutOfMemoryError();
             wp.reference = r;
@@ -1356,7 +1358,7 @@ class GC
                    if (wp.reference)
                        rt_detachDisposeEvent(wp.reference, &wp.ondestroy);
                   });
                    if (wp.reference)
                        rt_detachDisposeEvent(wp.reference, &wp.ondestroy);
                   });
-            libc.free(wp);
+            cstdlib.free(wp);
         }
     }
 
         }
     }
 
@@ -1479,16 +1481,16 @@ struct Gcx
         {
             Pool *pool = pooltable[i];
             pool.Dtor();
         {
             Pool *pool = pooltable[i];
             pool.Dtor();
-            libc.free(pool);
+            cstdlib.free(pool);
         }
         if (pooltable)
         }
         if (pooltable)
-            libc.free(pooltable);
+            cstdlib.free(pooltable);
 
         if (roots)
 
         if (roots)
-            libc.free(roots);
+            cstdlib.free(roots);
 
         if (ranges)
 
         if (ranges)
-            libc.free(ranges);
+            cstdlib.free(ranges);
     }
 
 
     }
 
 
@@ -1559,13 +1561,13 @@ struct Gcx
             size_t newdim = rootdim * 2 + 16;
             void** newroots;
 
             size_t newdim = rootdim * 2 + 16;
             void** newroots;
 
-            newroots = cast(void**) libc.malloc(newdim * newroots[0].sizeof);
+            newroots = cast(void**) cstdlib.malloc(newdim * newroots[0].sizeof);
             if (!newroots)
                 onOutOfMemoryError();
             if (roots)
             {
             if (!newroots)
                 onOutOfMemoryError();
             if (roots)
             {
-                libc.memcpy(newroots, roots, nroots * newroots[0].sizeof);
-                libc.free(roots);
+                cstring.memcpy(newroots, roots, nroots * newroots[0].sizeof);
+                cstdlib.free(roots);
             }
             roots = newroots;
             rootdim = newdim;
             }
             roots = newroots;
             rootdim = newdim;
@@ -1585,7 +1587,7 @@ struct Gcx
             if (roots[i] == p)
             {
                 nroots--;
             if (roots[i] == p)
             {
                 nroots--;
-                libc.memmove(roots + i, roots + i + 1,
+                cstring.memmove(roots + i, roots + i + 1,
                         (nroots - i) * roots[0].sizeof);
                 return;
             }
                         (nroots - i) * roots[0].sizeof);
                 return;
             }
@@ -1604,13 +1606,13 @@ struct Gcx
             size_t newdim = rangedim * 2 + 16;
             Range *newranges;
 
             size_t newdim = rangedim * 2 + 16;
             Range *newranges;
 
-            newranges = cast(Range*) libc.malloc(newdim * newranges[0].sizeof);
+            newranges = cast(Range*) cstdlib.malloc(newdim * Range.sizeof);
             if (!newranges)
                 onOutOfMemoryError();
             if (ranges)
             {
             if (!newranges)
                 onOutOfMemoryError();
             if (ranges)
             {
-                libc.memcpy(newranges, ranges, nranges * newranges[0].sizeof);
-                libc.free(ranges);
+                cstring.memcpy(newranges, ranges, nranges * Range.sizeof);
+                cstdlib.free(ranges);
             }
             ranges = newranges;
             rangedim = newdim;
             }
             ranges = newranges;
             rangedim = newdim;
@@ -1631,7 +1633,7 @@ struct Gcx
             if (ranges[i].pbot == pbot)
             {
                 nranges--;
             if (ranges[i].pbot == pbot)
             {
                 nranges--;
-                libc.memmove(ranges + i, ranges + i + 1,
+                cstring.memmove(ranges + i, ranges + i + 1,
                         (nranges - i) * ranges[0].sizeof);
                 return;
             }
                         (nranges - i) * ranges[0].sizeof);
                 return;
             }
@@ -1902,8 +1904,8 @@ struct Gcx
                 continue;
             }
             pool.Dtor();
                 continue;
             }
             pool.Dtor();
-            libc.free(pool);
-            libc.memmove(pooltable + n,
+            cstdlib.free(pool);
+            cstring.memmove(pooltable + n,
                             pooltable + n + 1,
                             (--npools - n) * (Pool*).sizeof);
             minAddr = pooltable[0].baseAddr;
                             pooltable + n + 1,
                             (--npools - n) * (Pool*).sizeof);
             minAddr = pooltable[0].baseAddr;
@@ -1989,10 +1991,10 @@ struct Gcx
       L1:
         pool.pagetable[pn] = B_PAGE;
         if (npages > 1)
       L1:
         pool.pagetable[pn] = B_PAGE;
         if (npages > 1)
-            libc.memset(&pool.pagetable[pn + 1], B_PAGEPLUS, npages - 1);
+            cstring.memset(&pool.pagetable[pn + 1], B_PAGEPLUS, npages - 1);
         p = pool.baseAddr + pn * PAGESIZE;
         p = pool.baseAddr + pn * PAGESIZE;
-        libc.memset(cast(char *)p + size, 0, npages * PAGESIZE - size);
-        debug (MEMSTOMP) libc.memset(p, 0xF1, size);
+        cstring.memset(cast(char *)p + size, 0, npages * PAGESIZE - size);
+        debug (MEMSTOMP) cstring.memset(p, 0xF1, size);
         return p;
 
       Lnomemory:
         return p;
 
       Lnomemory:
@@ -2034,7 +2036,7 @@ struct Gcx
                 npages = n;
         }
 
                 npages = n;
         }
 
-        pool = cast(Pool *) libc.calloc(1, Pool.sizeof);
+        pool = cast(Pool *) cstdlib.calloc(1, Pool.sizeof);
         if (pool)
         {
             pool.initialize(npages);
         if (pool)
         {
             pool.initialize(npages);
@@ -2042,7 +2044,7 @@ struct Gcx
                 goto Lerr;
 
             newnpools = npools + 1;
                 goto Lerr;
 
             newnpools = npools + 1;
-            newpooltable = cast(Pool **) libc.realloc(pooltable,
+            newpooltable = cast(Pool **) cstdlib.realloc(pooltable,
                     newnpools * (Pool *).sizeof);
             if (!newpooltable)
                 goto Lerr;
                     newnpools * (Pool *).sizeof);
             if (!newpooltable)
                 goto Lerr;
@@ -2053,7 +2055,7 @@ struct Gcx
                 if (pool.opCmp(newpooltable[i]) < 0)
                      break;
             }
                 if (pool.opCmp(newpooltable[i]) < 0)
                      break;
             }
-            libc.memmove(newpooltable + i + 1, newpooltable + i,
+            cstring.memmove(newpooltable + i + 1, newpooltable + i,
                     (npools - i) * (Pool *).sizeof);
             newpooltable[i] = pool;
 
                     (npools - i) * (Pool *).sizeof);
             newpooltable[i] = pool;
 
@@ -2067,7 +2069,7 @@ struct Gcx
 
       Lerr:
         pool.Dtor();
 
       Lerr:
         pool.Dtor();
-        libc.free(pool);
+        cstdlib.free(pool);
         return null;
     }
 
         return null;
     }
 
@@ -2431,7 +2433,7 @@ struct Gcx
                             List *list = cast(List *)p;
                             log_free(sentinel_add(list));
 
                             List *list = cast(List *)p;
                             log_free(sentinel_add(list));
 
-                            debug (MEMSTOMP) libc.memset(p, 0xF3, size);
+                            debug (MEMSTOMP) cstring.memset(p, 0xF3, size);
                         }
                         pool.pagetable[pn] = B_FREE;
                         freed += PAGESIZE;
                         }
                         pool.pagetable[pn] = B_FREE;
                         freed += PAGESIZE;
@@ -2452,7 +2454,7 @@ struct Gcx
                             List *list = cast(List *)p;
                             log_free(sentinel_add(list));
 
                             List *list = cast(List *)p;
                             log_free(sentinel_add(list));
 
-                            debug (MEMSTOMP) libc.memset(p, 0xF3, size);
+                            debug (MEMSTOMP) cstring.memset(p, 0xF3, size);
 
                             freed += size;
                         }
 
                             freed += size;
                         }
@@ -2473,7 +2475,7 @@ struct Gcx
                         log_free(sentinel_add(p));
                         pool.pagetable[pn] = B_FREE;
                         freedpages++;
                         log_free(sentinel_add(p));
                         pool.pagetable[pn] = B_FREE;
                         freedpages++;
-                        debug (MEMSTOMP) libc.memset(p, 0xF3, PAGESIZE);
+                        debug (MEMSTOMP) cstring.memset(p, 0xF3, PAGESIZE);
                         while (pn + 1 < pool.npages && pool.pagetable[pn + 1] == B_PAGEPLUS)
                         {
                             pn++;
                         while (pn + 1 < pool.npages && pool.pagetable[pn + 1] == B_PAGEPLUS)
                         {
                             pn++;
@@ -2483,7 +2485,7 @@ struct Gcx
                             debug (MEMSTOMP)
                             {
                                 p += PAGESIZE;
                             debug (MEMSTOMP)
                             {
                                 p += PAGESIZE;
-                                libc.memset(p, 0xF3, PAGESIZE);
+                                cstring.memset(p, 0xF3, PAGESIZE);
                             }
                         }
                     }
                             }
                         }
                     }
@@ -2766,10 +2768,10 @@ struct Pool
         freebits.alloc(cast(size_t)poolsize / 16);
         noscan.alloc(cast(size_t)poolsize / 16);
 
         freebits.alloc(cast(size_t)poolsize / 16);
         noscan.alloc(cast(size_t)poolsize / 16);
 
-        pagetable = cast(ubyte*) libc.malloc(npages);
+        pagetable = cast(ubyte*) cstdlib.malloc(npages);
         if (!pagetable)
             onOutOfMemoryError();
         if (!pagetable)
             onOutOfMemoryError();
-        libc.memset(pagetable, B_FREE, npages);
+        cstring.memset(pagetable, B_FREE, npages);
 
         this.npages = npages;
     }
 
         this.npages = npages;
     }
@@ -2792,7 +2794,7 @@ struct Pool
             topAddr = null;
         }
         if (pagetable)
             topAddr = null;
         }
         if (pagetable)
-            libc.free(pagetable);
+            cstdlib.free(pagetable);
 
         mark.Dtor();
         scan.Dtor();
 
         mark.Dtor();
         scan.Dtor();
@@ -2857,7 +2859,7 @@ struct Pool
      */
     void freePages(size_t pagenum, size_t npages)
     {
      */
     void freePages(size_t pagenum, size_t npages)
     {
-        libc.memset(&pagetable[pagenum], B_FREE, npages);
+        cstring.memset(&pagetable[pagenum], B_FREE, npages);
     }
 
 
     }
 
 
index 703bbef6c997b4b0921e3b1ee36254c583de7ea1..4a6cbec718bca8d8270a3987c769c988ece48bd1 100644 (file)
@@ -28,7 +28,8 @@ module rt.gc.cdgc.iface;
 
 import rt.gc.cdgc.gc: GC, BlkInfo;
 import rt.gc.cdgc.stats: GCStats;
 
 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;
 
 
 version=GCCLASS;
 
@@ -66,13 +67,13 @@ extern (C) void gc_init()
     version (GCCLASS)
     {
         ClassInfo ci = GC.classinfo;
     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
     {
         (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) {
     }
     _gc.initialize();
     version (DigitalMars) version(OSX) {
diff --git a/rt/gc/cdgc/libc.d b/rt/gc/cdgc/libc.d
deleted file mode 100644 (file)
index 3c40cf9..0000000
+++ /dev/null
@@ -1,29 +0,0 @@
-
-module rt.gc.cdgc.libc;
-
-version (Windows) {
-    alias int   c_long;
-    alias uint  c_ulong;
-}
-else {
-    static if ((void*).sizeof > int.sizeof) {
-        alias long c_long;
-        alias ulong c_ulong;
-    }
-    else {
-        alias int c_long;
-        alias uint c_ulong;
-    }
-}
-
-// C standard library
-extern (C):
-void* realloc(void*, size_t);
-void* malloc(size_t);
-void* calloc(size_t, size_t);
-void free(void*);
-void* memset(void*, int, size_t);
-void* memcpy(void*, void*, size_t);
-void* memmove(void*, void*, size_t);
-void printf(char* fmt, ...);
-