From 58601dba4eeea662fb023c1f8c491bf4f6bb0668 Mon Sep 17 00:00:00 2001 From: Leandro Lucarella Date: Mon, 28 Jun 2010 21:09:55 -0300 Subject: [PATCH 1/1] Remove Gcx destructor There is no point on freeing memory as the OS will do it for us. --- rt/gc/cdgc/gc.d | 35 ----------------------------------- rt/gc/cdgc/iface.d | 1 - 2 files changed, 36 deletions(-) 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(); -- 2.43.0