mirror of
https://github.com/nim-lang/Nim.git
synced 2026-01-07 05:23:20 +00:00
* first implementation of the =trace and =dispose hooks for the cycle collector * a cycle collector for ARC: progress * manual: the .acyclic pragma is a thing once again * gcbench: adaptations for --gc:arc * enable valgrind tests for the strutils tests * testament: better valgrind support * ARC refactoring: growable jumpstacks * ARC cycle detector: non-recursive algorithm * moved and renamed core/ files back to system/ * refactoring: --gc:arc vs --gc:orc since 'orc' is even more experimental and we want to ship --gc:arc soonish
19 lines
290 B
Nim
19 lines
290 B
Nim
discard """
|
|
output: "MEM 0"
|
|
cmd: "nim c --gc:orc $file"
|
|
"""
|
|
|
|
type
|
|
Node = ref object
|
|
kids: seq[Node]
|
|
data: string
|
|
|
|
proc main(x: int) =
|
|
var n = Node(kids: @[], data: "3" & $x)
|
|
let m = n
|
|
n.kids.add m
|
|
|
|
let mem = getOccupiedMem()
|
|
main(90)
|
|
echo "MEM ", getOccupiedMem() - mem
|