ARC: ported the GC tests over to --gc:arc

This commit is contained in:
Araq
2019-11-25 15:29:41 +01:00
committed by Andreas Rumpf
parent 879801c639
commit 72237e2bcf
14 changed files with 79 additions and 29 deletions

View File

@@ -304,3 +304,12 @@ proc `$`*(x: uint64): string {.noSideEffect, raises: [].} =
let half = i div 2
# Reverse
for t in 0 .. half-1: swap(result[t], result[i-t-1])
when defined(gcDestructors):
proc GC_getStatistics*(): string =
result = "[GC] total memory: "
result.addInt getTotalMem()
result.add "\n[GC] occupied memory: "
result.addInt getOccupiedMem()
result.add '\n'
#"[GC] cycle collections: " & $gch.stat.cycleCollections & "\n" &