Files
Nim/tests/gc/tfinalizers.nim
Andreas Rumpf 17e0dae12f fixes #4851 [backport] (#24954)
(cherry picked from commit 1e602490e9)
2025-05-19 17:48:22 +02:00

20 lines
257 B
Nim

type
PNode = ref TNode
TNode = object
le: PNode
proc finalizeNode(n: PNode) =
var s = @[0]
proc returnTree() =
var cycle: PNode
new(cycle, finalizeNode)
cycle.le = cycle
for i in 1..100:
returnTree()
GC_fullCollect()
GC_fullCollect()