summary refs log tree commit diff stats
path: root/lib/system
diff options
context:
space:
mode:
authorAraq <rumpf_a@web.de>2011-04-17 20:17:45 +0200
committerAraq <rumpf_a@web.de>2011-04-17 20:17:45 +0200
commit48dd9679bd2196369a8a6f93f6225ad730683c25 (patch)
treeb688e2d7e426c571b7fd898b6866205b70925e0d /lib/system
parente487c0a2491fcc144cb47b54597a320e2bf79866 (diff)
downloadNim-48dd9679bd2196369a8a6f93f6225ad730683c25.tar.gz
:= templatable; lexer improvements
Diffstat (limited to 'lib/system')
-rwxr-xr-xlib/system/gc.nim6
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/system/gc.nim b/lib/system/gc.nim
index eb4811bf5..950b60c27 100755
--- a/lib/system/gc.nim
+++ b/lib/system/gc.nim
@@ -642,7 +642,11 @@ proc unmarkStackAndRegisters(gch: var TGcHeap) =
   var d = gch.decStack.d
   for i in 0..gch.decStack.len-1:
     assert isAllocatedPtr(allocator, d[i])
-    decRef(d[i]) # OPT: cannot create a cycle!
+    # decRef(d[i]) inlined: cannot create a cycle
+    var c = d[i]
+    if atomicDec(c.refcount, rcIncrement) <% rcIncrement:
+      rtlAddZCT(c)
+    assert c.typ != nil
   gch.decStack.len = 0
 
 proc collectCT(gch: var TGcHeap) =