Mark setupForeignThreadGc and initGC as gcsafe (#5353)

This commit is contained in:
Anatoly Galiulin 2017-02-08 16:26:15 +07:00 • committed by Andreas Rumpf
commit 61b4bb5af5
2 changed files with 2 additions and 2 deletions

View file

@ -2630,7 +2630,7 @@ when not defined(JS): #and not defined(nimscript):
when hasAlloc: when hasAlloc:
when not defined(gcStack): when not defined(gcStack):
proc initGC() proc initGC() {.gcsafe.}
when not defined(boehmgc) and not defined(useMalloc) and when not defined(boehmgc) and not defined(useMalloc) and
not defined(gogc) and not defined(gcStack): not defined(gogc) and not defined(gcStack):
proc initAllocator() {.inline.} proc initAllocator() {.inline.}

View file

@ -135,7 +135,7 @@ when allowForeignThreadGc:
var var
localGcInitialized {.rtlThreadVar.}: bool localGcInitialized {.rtlThreadVar.}: bool
proc setupForeignThreadGc*() = proc setupForeignThreadGc*() {.gcsafe.} =
## Call this if you registered a callback that will be run from a thread not ## Call this if you registered a callback that will be run from a thread not
## under your control. This has a cheap thread-local guard, so the GC for ## under your control. This has a cheap thread-local guard, so the GC for
## this thread will only be initialized once per thread, no matter how often ## this thread will only be initialized once per thread, no matter how often