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:
Andreas Rumpf 2019-12-17 17:37:50 +01:00 • committed by GitHub
commit 83a736a34a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
45 changed files with 939 additions and 229 deletions

View file

@ -179,9 +179,9 @@ proc gcTests(r: var TResults, cat: Category, options: string) =
" -d:release -d:useRealtimeGC", cat)
when filename != "gctest":
testSpec r, makeTest("tests/gc" / filename, options &
" --gc:arc", cat)
" --gc:orc", cat)
testSpec r, makeTest("tests/gc" / filename, options &
" --gc:arc -d:release", cat)
" --gc:orc -d:release", cat)
template testWithoutBoehm(filename: untyped) =
testWithoutMs filename

View file

@ -170,7 +170,8 @@ proc parseSpec*(filename: string): TSpec =
of "tcolumn":
discard parseInt(e.value, result.tcolumn)
of "output":
result.outputCheck = ocEqual
if result.outputCheck != ocSubstr:
result.outputCheck = ocEqual
result.output = strip(e.value)
of "input":
result.input = e.value
@ -200,6 +201,8 @@ proc parseSpec*(filename: string): TSpec =
when defined(linux) and sizeof(int) == 8:
result.useValgrind = parseCfgBool(e.value)
result.unjoinable = true
if result.useValgrind:
result.outputCheck = ocSubstr
else:
# Windows lacks valgrind. Silly OS.
# Valgrind only supports OSX <= 17.x

View file

@ -449,7 +449,7 @@ proc testSpecHelper(r: var TResults, test: TTest, expected: TSpec, target: TTarg
else:
exeCmd = exeFile
if expected.useValgrind:
args = exeCmd & args
args = @["--error-exitcode=1"] & exeCmd & args
exeCmd = "valgrind"
var (_, buf, exitCode) = execCmdEx2(exeCmd, args, input = expected.input)
# Treat all failure codes from nodejs as 1. Older versions of nodejs used