Merge pull request #4855 from ftsf/fix-foreignthreads

call initAllocator in foreign thread
This commit is contained in:
Andreas Rumpf 2016-10-05 17:38:37 +02:00 • committed by GitHub
commit 989f794927

View file

@ -120,6 +120,7 @@ when allowForeignThreadGc:
## switches are used ## switches are used
if not localGcInitialized: if not localGcInitialized:
localGcInitialized = true localGcInitialized = true
initAllocator()
var stackTop {.volatile.}: pointer var stackTop {.volatile.}: pointer
setStackBottom(addr(stackTop)) setStackBottom(addr(stackTop))
initGC() initGC()