GC stack scanning cares about interior pointers

This commit is contained in:
Araq 2011-12-30 11:03:01 +01:00
commit 73919e3082
10 changed files with 328 additions and 29 deletions

View file

@ -44,7 +44,8 @@ proc main(infile, outfile: string, options: PParserOptions) =
var module = parseUnit(p)
closeParser(p)
renderModule(module, outfile)
rawMessage(hintSuccessX, [$gLinesCompiled, $(getTime() - start)])
rawMessage(hintSuccessX, [$gLinesCompiled, $(getTime() - start),
formatSize(getTotalMem())])
var
infile = ""

View file

@ -1594,7 +1594,7 @@ proc parseSwitch(p: var TParser): PNode =
eat(p, pxCurlyRi)
proc addStmt(sl, a: PNode) =
# merge type sections is possible:
# merge type sections if possible:
if a.kind != nkTypeSection or sonsLen(sl) == 0 or
lastSon(sl).kind != nkTypeSection:
addSon(sl, a)

View file

@ -344,7 +344,7 @@ const
warnWriteToForeignHeap: "write to foreign heap [WriteToForeignHeap]",
warnUser: "$1 [User]",
hintSuccess: "operation successful [Success]",
hintSuccessX: "operation successful ($1 lines compiled; $2 sec total) [SuccessX]",
hintSuccessX: "operation successful ($# lines compiled; $# sec total; $#) [SuccessX]",
hintLineTooLong: "line too long [LineTooLong]",
hintXDeclaredButNotUsed: "\'$1\' is declared but not used [XDeclaredButNotUsed]",
hintConvToBaseNotNeeded: "conversion to base object is not needed [ConvToBaseNotNeeded]",

View file

@ -61,9 +61,9 @@ proc prependCurDir(f: string): string =
else:
result = f
proc HandleCmdLine() =
proc HandleCmdLine() =
var start = epochTime()
if paramCount() == 0:
if paramCount() == 0:
writeCommandLineUsage()
else:
# Process command line arguments:
@ -85,13 +85,15 @@ proc HandleCmdLine() =
ProcessCmdLine(passCmd2)
MainCommand()
if gVerbosity >= 2: echo(GC_getStatistics())
#echo(GC_getStatistics())
if msgs.gErrorCounter == 0:
when hasTinyCBackend:
if gCmd == cmdRun:
tccgen.run()
if gCmd notin {cmdInterpret, cmdRun}:
rawMessage(hintSuccessX, [$gLinesCompiled,
formatFloat(epochTime() - start, ffDecimal, 3)])
if gCmd notin {cmdInterpret, cmdRun}:
rawMessage(hintSuccessX, [$gLinesCompiled,
formatFloat(epochTime() - start, ffDecimal, 3),
formatSize(getTotalMem())])
if optRun in gGlobalOptions:
var ex = quoteIfContainsWhite(
changeFileExt(gProjectFull, "").prependCurDir)