diff options
Diffstat (limited to 'lib/system/cyclebreaker.nim')
-rw-r--r-- | lib/system/cyclebreaker.nim | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/system/cyclebreaker.nim b/lib/system/cyclebreaker.nim index 6ec0f01f7..45b0a5a65 100644 --- a/lib/system/cyclebreaker.nim +++ b/lib/system/cyclebreaker.nim @@ -138,7 +138,8 @@ proc breakCycles(s: Cell; desc: PNimTypeV2) = else: # anyhow as a link that the produced destructor does not have to follow: u[] = nil - cprintf("[Bug] %p %s RC %ld\n", t, desc.name, t.rc shr rcShift) + when traceCollector: + cprintf("[Bug] %p %s RC %ld\n", t, desc.name, t.rc shr rcShift) deinit j.traceStack proc thinout*[T](x: ref T) {.inline.} = @@ -148,7 +149,7 @@ proc thinout*[T](x: ref T) {.inline.} = ## and thus would keep the graph from being freed are `nil`'ed. ## This is a form of cycle collection that works well with Nim's ARC ## and its associated cost model. - proc getDynamicTypeInfo[T](x: T): PNimTypeV2 {.magic: "GetTypeInfoV2", noSideEffect, locks: 0.} + proc getDynamicTypeInfo[T](x: T): PNimTypeV2 {.magic: "GetTypeInfoV2", noSideEffect.} breakCycles(head(cast[pointer](x)), getDynamicTypeInfo(x[])) |