Merge pull request #4015 from arnetheduck/initallocator-fix

fix initAllocator not being called when defined(nogc) and not defined…
This commit is contained in:
Andreas Rumpf 2016-10-13 23:25:05 +02:00 • committed by GitHub
commit 3ba2d08bbc
2 changed files with 10 additions and 3 deletions

View file

@ -2581,10 +2581,11 @@ else:
when not defined(JS): #and not defined(nimscript): when not defined(JS): #and not defined(nimscript):
{.push stack_trace: off, profiler:off.} {.push stack_trace: off, profiler:off.}
when not defined(nimscript) and not defined(nogc): when hasAlloc:
when not defined(gcStack): when not defined(gcStack):
proc initGC() 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 initAllocator() {.inline.}
proc initStackBottom() {.inline, compilerproc.} = proc initStackBottom() {.inline, compilerproc.} =
@ -2602,7 +2603,6 @@ when not defined(JS): #and not defined(nimscript):
when declared(setStackBottom): when declared(setStackBottom):
setStackBottom(locals) setStackBottom(locals)
when hasAlloc:
var var
strDesc = TNimType(size: sizeof(string), kind: tyString, flags: {ntfAcyclic}) strDesc = TNimType(size: sizeof(string), kind: tyString, flags: {ntfAcyclic})

View file

@ -115,6 +115,12 @@ proc dllTests(r: var TResults, cat: Category, options: string) =
# ------------------------------ GC tests ------------------------------------- # ------------------------------ GC tests -------------------------------------
proc gcTests(r: var TResults, cat: Category, options: string) = proc gcTests(r: var TResults, cat: Category, options: string) =
template testWithNone(filename: untyped) =
testSpec r, makeTest("tests/gc" / filename, options &
" --gc:none", cat, actionRun)
testSpec r, makeTest("tests/gc" / filename, options &
" -d:release --gc:none", cat, actionRun)
template testWithoutMs(filename: untyped) = template testWithoutMs(filename: untyped) =
testSpec r, makeTest("tests/gc" / filename, options, cat, actionRun) testSpec r, makeTest("tests/gc" / filename, options, cat, actionRun)
testSpec r, makeTest("tests/gc" / filename, options & testSpec r, makeTest("tests/gc" / filename, options &
@ -144,6 +150,7 @@ proc gcTests(r: var TResults, cat: Category, options: string) =
test "gcleak" test "gcleak"
test "gcleak2" test "gcleak2"
test "gctest" test "gctest"
testWithNone "gctest"
test "gcleak3" test "gcleak3"
test "gcleak4" test "gcleak4"
# Disabled because it works and takes too long to run: # Disabled because it works and takes too long to run: