ARC: cycle detector (#12823)
* 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
This commit is contained in:
parent
5848f0042c
commit
83a736a34a
45 changed files with 939 additions and 229 deletions
|
|
@ -53,11 +53,11 @@ import
|
|||
|
||||
type
|
||||
PNode = ref TNode
|
||||
TNode {.final.} = object
|
||||
TNode {.final, acyclic.} = object
|
||||
left, right: PNode
|
||||
i, j: int
|
||||
|
||||
proc newNode(L, r: PNode): PNode =
|
||||
proc newNode(L, r: sink PNode): PNode =
|
||||
new(result)
|
||||
result.left = L
|
||||
result.right = r
|
||||
|
|
@ -166,9 +166,13 @@ proc main() =
|
|||
|
||||
var elapsed = epochTime() - t
|
||||
printDiagnostics()
|
||||
echo("Completed in " & $elapsed & "ms. Success!")
|
||||
echo("Completed in " & $elapsed & "s. Success!")
|
||||
|
||||
when defined(GC_setMaxPause):
|
||||
GC_setMaxPause 2_000
|
||||
|
||||
when defined(gcDestructors):
|
||||
let mem = getOccupiedMem()
|
||||
main()
|
||||
when defined(gcDestructors):
|
||||
doAssert getOccupiedMem() == mem
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue