From 2b74bbba0e2a7c287098ea963b7bade0cf57ef35 Mon Sep 17 00:00:00 2001 From: Jacek Sieka Date: Wed, 30 Mar 2016 20:56:44 +0800 Subject: 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(-) (limited to 'lib') 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 -- cgit 1.4.1-2-gfad0 From 3116744c86f37ac4e4e5fec3d6d1635304ed717f Mon Sep 17 00:00:00 2001 From: Jacek Sieka Date: Thu, 25 Aug 2016 20:17:30 +0800 Subject: no allocator init for nimscript --- lib/system.nim | 1 + 1 file changed, 1 insertion(+) (limited to 'lib') diff --git a/lib/system.nim b/lib/system.nim index ce32baf38..da37512d6 100644 --- a/lib/system.nim +++ b/lib/system.nim @@ -2565,6 +2565,7 @@ when not defined(JS): #and not defined(nimscript): {.push stack_trace: off, profiler:off.} when not ( + defined(nimscript) or defined(boehmgc) or defined(gogc) or (defined(nogc) and defined(useMalloc))): -- cgit 1.4.1-2-gfad0 From 260e615017977592c4a165fc0289b5e77f182a64 Mon Sep 17 00:00:00 2001 From: Jacek Sieka Date: Thu, 25 Aug 2016 23:04:44 +0800 Subject: simplify initallocator conditions --- lib/system.nim | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'lib') diff --git a/lib/system.nim b/lib/system.nim index 6af5dc01f..c97ccf4eb 100644 --- a/lib/system.nim +++ b/lib/system.nim @@ -2582,10 +2582,10 @@ else: when not defined(JS): #and not defined(nimscript): {.push stack_trace: off, profiler:off.} - when not defined(nimscript) and (not defined(nogc) or not defined(useMalloc)): + when not defined(nimscript): when not defined(gcStack): proc initGC() - when not defined(boehmgc) and not defined(gogc) and not defined(gcStack): + when not defined(boehmgc) and not defined(useMalloc) and not defined(gogc) and not defined(gcStack): proc initAllocator() {.inline.} proc initStackBottom() {.inline, compilerproc.} = -- cgit 1.4.1-2-gfad0 From a65b44cae90b0b9f4edfad93922c12be957e513e Mon Sep 17 00:00:00 2001 From: Jacek Sieka Date: Sat, 3 Sep 2016 10:56:27 +0800 Subject: one more fix condition --- lib/system.nim | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'lib') diff --git a/lib/system.nim b/lib/system.nim index c97ccf4eb..26feb5ce8 100644 --- a/lib/system.nim +++ b/lib/system.nim @@ -2582,10 +2582,11 @@ else: when not defined(JS): #and not defined(nimscript): {.push stack_trace: off, profiler:off.} - when not defined(nimscript): + when hasAlloc: when not defined(gcStack): proc initGC() - when not defined(boehmgc) and not defined(useMalloc) and not defined(gogc) and not defined(gcStack): + when not defined(boehmgc) and not defined(useMalloc) and + not defined(gogc) and not defined(gcStack): proc initAllocator() {.inline.} proc initStackBottom() {.inline, compilerproc.} = @@ -2603,7 +2604,6 @@ when not defined(JS): #and not defined(nimscript): when declared(setStackBottom): setStackBottom(locals) - when hasAlloc: var strDesc = TNimType(size: sizeof(string), kind: tyString, flags: {ntfAcyclic}) -- cgit 1.4.1-2-gfad0