summary refs log tree commit diff stats
path: root/lib/system/arc.nim
diff options
context:
space:
mode:
Diffstat (limited to 'lib/system/arc.nim')
-rw-r--r--lib/system/arc.nim2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/system/arc.nim b/lib/system/arc.nim
index 99c892676..d001fcaa5 100644
--- a/lib/system/arc.nim
+++ b/lib/system/arc.nim
@@ -221,7 +221,7 @@ proc nimDecRefIsLast(p: pointer): bool {.compilerRtl, inl.} =
 
     when defined(gcAtomicArc) and hasThreadSupport:
       # `atomicDec` returns the new value
-      if atomicDec(cell.rc, rcIncrement) == -1:
+      if atomicDec(cell.rc, rcIncrement) == -rcIncrement:
         result = true
         when traceCollector:
           cprintf("[ABOUT TO DESTROY] %p\n", cell)