summary refs log tree commit diff stats
path: root/lib/system/gc.nim
diff options
context:
space:
mode:
Diffstat (limited to 'lib/system/gc.nim')
-rwxr-xr-xlib/system/gc.nim8
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/system/gc.nim b/lib/system/gc.nim
index 033a7bdbe..619b1c9b1 100755
--- a/lib/system/gc.nim
+++ b/lib/system/gc.nim
@@ -198,18 +198,18 @@ proc prepareDealloc(cell: PCell) =
 
 proc rtlAddCycleRoot(c: PCell) {.rtl, inl.} = 
   # we MUST access gch as a global here, because this crosses DLL boundaries!
-  when hasThreadSupport:
+  when hasThreadSupport and hasSharedHeap:
     AcquireSys(HeapLock)
   incl(gch.cycleRoots, c)
-  when hasThreadSupport:  
+  when hasThreadSupport and hasSharedHeap:
     ReleaseSys(HeapLock)
 
 proc rtlAddZCT(c: PCell) {.rtl, inl.} =
   # we MUST access gch as a global here, because this crosses DLL boundaries!
-  when hasThreadSupport:
+  when hasThreadSupport and hasSharedHeap:
     AcquireSys(HeapLock)
   addZCT(gch.zct, c)
-  when hasThreadSupport:
+  when hasThreadSupport and hasSharedHeap:
     ReleaseSys(HeapLock)
 
 proc decRef(c: PCell) {.inline.} =