From: Leandro Lucarella Date: Tue, 29 Jun 2010 00:09:55 +0000 (-0300) Subject: Remove Gcx destructor X-Git-Url: https://git.llucax.com/software/dgc/cdgc.git/commitdiff_plain/58601dba4eeea662fb023c1f8c491bf4f6bb0668?hp=d512e824a57ab7912ce0c57798a8560479637c10 Remove Gcx destructor There is no point on freeing memory as the OS will do it for us. --- diff --git a/rt/gc/cdgc/gc.d b/rt/gc/cdgc/gc.d index 1e95f06..6ed0b1d 100644 --- a/rt/gc/cdgc/gc.d +++ b/rt/gc/cdgc/gc.d @@ -143,17 +143,6 @@ class GC } - void Dtor() - { - if (gcx) - { - gcx.Dtor(); - cstdlib.free(gcx); - gcx = null; - } - } - - /** * */ @@ -1368,30 +1357,6 @@ struct Gcx } - void Dtor() - { - inited = 0; - - for (size_t i = 0; i < npools; i++) - { - Pool *pool = pooltable[i]; - pool.Dtor(); - cstdlib.free(pool); - } - - // Even when free() can be called with a null pointer, the extra call - // might be significant. On hard GC benchmarks making the test for null - // here (i.e. not making the call) can reduce the GC time by almost - // ~5%. - if (pooltable) - cstdlib.free(pooltable); - if (roots) - cstdlib.free(roots); - if (ranges) - cstdlib.free(ranges); - } - - void Invariant() { } diff --git a/rt/gc/cdgc/iface.d b/rt/gc/cdgc/iface.d index eb87dfd..fec035a 100644 --- a/rt/gc/cdgc/iface.d +++ b/rt/gc/cdgc/iface.d @@ -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();