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.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: