From 2b74bbba0e2a7c287098ea963b7bade0cf57ef35 Mon Sep 17 00:00:00 2001 From: Jacek Sieka Date: Wed, 30 Mar 2016 20:56:44 +0800 Subject: [PATCH] fix initAllocator not being called when defined(nogc) and not defined(useMalloc) else bottom is not properly initialized - running with sysAssert catches this issue nicely --- lib/system.nim | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/lib/system.nim b/lib/system.nim index fefabe53f3..ce32baf38b 100644 --- a/lib/system.nim +++ b/lib/system.nim @@ -2564,10 +2564,14 @@ else: when not defined(JS): #and not defined(nimscript): {.push stack_trace: off, profiler:off.} + when not ( + defined(boehmgc) or + defined(gogc) or + (defined(nogc) and defined(useMalloc))): + proc initAllocator() {.inline.} + when not defined(nimscript) and not defined(nogc): proc initGC() - when not defined(boehmgc) and not defined(useMalloc) and not defined(gogc): - proc initAllocator() {.inline.} proc initStackBottom() {.inline, compilerproc.} = # WARNING: This is very fragile! An array size of 8 does not work on my