From c7848730fed4af4c843bd887409acfe770a793ba Mon Sep 17 00:00:00 2001 From: Leandro Lucarella Date: Wed, 20 Oct 2010 21:30:49 -0300 Subject: [PATCH] Avoid compile error for LDC The variables used in scope(exit) must be declared before the scope statement. --- rt/gc/cdgc/gc.d | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/rt/gc/cdgc/gc.d b/rt/gc/cdgc/gc.d index d4fb0e2..e6b3c11 100644 --- a/rt/gc/cdgc/gc.d +++ b/rt/gc/cdgc/gc.d @@ -1323,13 +1323,13 @@ private void *malloc(size_t size, uint attrs, size_t* pm_bitmask) { assert(size != 0); + void *p = null; + Bins bin; + gc.stats.malloc_started(size, attrs, pm_bitmask); scope (exit) gc.stats.malloc_finished(p); - void *p = null; - Bins bin; - if (opts.options.sentinel) size += SENTINEL_EXTRA; -- 2.43.0