summary refs log tree commit diff stats
path: root/lib/system/arc.nim
diff options
context:
space:
mode:
authorAndreas Rumpf <rumpf_a@web.de>2020-09-18 11:55:58 +0200
committerGitHub <noreply@github.com>2020-09-18 11:55:58 +0200
commitd19316bbb986a7dd1d6d091173963f6e74c65991 (patch)
tree962eb2e81643561db16e49a4647385dd75b5ac38 /lib/system/arc.nim
parent59b7857167ad458290dc57c4e39ca564b3080e52 (diff)
downloadNim-d19316bbb986a7dd1d6d091173963f6e74c65991.tar.gz
more ORC bugfixes (#15355)
* introduced --define:nimArcIds

* ORC: bugfixes
Diffstat (limited to 'lib/system/arc.nim')
-rw-r--r--lib/system/arc.nim6
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/system/arc.nim b/lib/system/arc.nim
index 68376cdab..3cbd02806 100644
--- a/lib/system/arc.nim
+++ b/lib/system/arc.nim
@@ -54,7 +54,7 @@ type
     when defined(gcOrc):
       rootIdx: int # thanks to this we can delete potential cycle roots
                    # in O(1) without doubly linked lists
-    when defined(nimArcDebug):
+    when defined(nimArcDebug) or defined(nimArcIds):
       refId: int
 
   Cell = ptr RefHeader
@@ -72,6 +72,8 @@ when defined(nimArcDebug):
 
   var gRefId: int
   var freedCells: CellSet
+elif defined(nimArcIds):
+  var gRefId: int
 
 proc nimNewObj(size: int): pointer {.compilerRtl.} =
   let s = size + sizeof(RefHeader)
@@ -85,7 +87,7 @@ proc nimNewObj(size: int): pointer {.compilerRtl.} =
     result = allocShared0(s) +! sizeof(RefHeader)
   else:
     result = alloc0(s) +! sizeof(RefHeader)
-  when defined(nimArcDebug):
+  when defined(nimArcDebug) or defined(nimArcIds):
     head(result).refId = gRefId
     atomicInc gRefId
   when traceCollector: