summary refs log tree commit diff stats
path: root/lib
diff options
context:
space:
mode:
authorJacek Sieka <arnetheduck@gmail.com>2016-03-30 20:56:44 +0800
committerJacek Sieka <arnetheduck@gmail.com>2016-03-30 20:56:44 +0800
commit2b74bbba0e2a7c287098ea963b7bade0cf57ef35 (patch)
treeb58de630f231f687d8f9df8972fb6c4d5f808aa9 /lib
parent3b732259c04dcb9ee763caf9f7697677624b7dc3 (diff)
downloadNim-2b74bbba0e2a7c287098ea963b7bade0cf57ef35.tar.gz
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
Diffstat (limited to 'lib')
-rw-r--r--lib/system.nim8
1 files changed, 6 insertions, 2 deletions
diff --git a/lib/system.nim b/lib/system.nim
index fefabe53f..ce32baf38 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