From 61b4bb5af5588b95a9b050e9925960ead87b0ea1 Mon Sep 17 00:00:00 2001 From: Anatoly Galiulin Date: Wed, 8 Feb 2017 16:26:15 +0700 Subject: [PATCH] Mark setupForeignThreadGc and initGC as gcsafe (#5353) --- lib/system.nim | 2 +- lib/system/gc_common.nim | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/system.nim b/lib/system.nim index 09d48fd12b..5d17f76517 100644 --- a/lib/system.nim +++ b/lib/system.nim @@ -2630,7 +2630,7 @@ when not defined(JS): #and not defined(nimscript): when hasAlloc: when not defined(gcStack): - proc initGC() + proc initGC() {.gcsafe.} when not defined(boehmgc) and not defined(useMalloc) and not defined(gogc) and not defined(gcStack): proc initAllocator() {.inline.} diff --git a/lib/system/gc_common.nim b/lib/system/gc_common.nim index aec8b67cbd..8f9d1edb6e 100644 --- a/lib/system/gc_common.nim +++ b/lib/system/gc_common.nim @@ -135,7 +135,7 @@ when allowForeignThreadGc: var localGcInitialized {.rtlThreadVar.}: bool - proc setupForeignThreadGc*() = + proc setupForeignThreadGc*() {.gcsafe.} = ## 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 ## this thread will only be initialized once per thread, no matter how often