memory allocator hotfix: do not allocate tremendous amounts of memory

This commit is contained in:
Andreas Rumpf
2017-01-13 12:07:19 +01:00
parent e142f4c371
commit 9753782f96
2 changed files with 18 additions and 12 deletions

View File

@@ -271,9 +271,13 @@ proc mainCommand*(graph: ModuleGraph; cache: IdentCache) =
if msgs.gErrorCounter == 0 and
gCmd notin {cmdInterpret, cmdRun, cmdDump}:
when declared(system.getMaxMem):
let usedMem = formatSize(getMaxMem()) & " peekmem"
else:
let usedMem = formatSize(getTotalMem())
rawMessage(hintSuccessX, [$gLinesCompiled,
formatFloat(epochTime() - gLastCmdTime, ffDecimal, 3),
formatSize(getTotalMem()),
usedMem,
if condSyms.isDefined("release"): "Release Build"
else: "Debug Build"])