mirror of
https://github.com/nim-lang/Nim.git
synced 2025-12-30 01:44:37 +00:00
Merge pull request #4015 from arnetheduck/initallocator-fix
fix initAllocator not being called when defined(nogc) and not defined…
This commit is contained in:
@@ -2581,10 +2581,11 @@ else:
|
||||
when not defined(JS): #and not defined(nimscript):
|
||||
{.push stack_trace: off, profiler:off.}
|
||||
|
||||
when not defined(nimscript) and not defined(nogc):
|
||||
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.} =
|
||||
@@ -2602,7 +2603,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})
|
||||
|
||||
|
||||
@@ -115,6 +115,12 @@ proc dllTests(r: var TResults, cat: Category, options: string) =
|
||||
# ------------------------------ GC tests -------------------------------------
|
||||
|
||||
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) =
|
||||
testSpec r, makeTest("tests/gc" / filename, options, cat, actionRun)
|
||||
testSpec r, makeTest("tests/gc" / filename, options &
|
||||
@@ -144,6 +150,7 @@ proc gcTests(r: var TResults, cat: Category, options: string) =
|
||||
test "gcleak"
|
||||
test "gcleak2"
|
||||
test "gctest"
|
||||
testWithNone "gctest"
|
||||
test "gcleak3"
|
||||
test "gcleak4"
|
||||
# Disabled because it works and takes too long to run:
|
||||
|
||||
Reference in New Issue
Block a user