diff options
author | Andreas Rumpf <rumpf_a@web.de> | 2016-11-21 12:07:17 +0100 |
---|---|---|
committer | Andreas Rumpf <rumpf_a@web.de> | 2016-11-21 12:10:44 +0100 |
commit | 02a2180a6a7f819add2e53053ccabfd80a59718d (patch) | |
tree | 135fcae1b038bd17e07ccb2a752ebda8598e999a /lib/system.nim | |
parent | fa101a722f80646bcbf86b94b4c2ce2a4dce93a8 (diff) | |
download | Nim-02a2180a6a7f819add2e53053ccabfd80a59718d.tar.gz |
first version of the new memory tracking feature
Diffstat (limited to 'lib/system.nim')
-rw-r--r-- | lib/system.nim | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/lib/system.nim b/lib/system.nim index 9547673a5..69d3db291 100644 --- a/lib/system.nim +++ b/lib/system.nim @@ -1272,12 +1272,14 @@ const seqShallowFlag = low(int) +{.push profiler: off.} when defined(nimKnowsNimvm): let nimvm* {.magic: "Nimvm".}: bool = false ## may be used only in "when" expression. ## It is true in Nim VM context and false otherwise else: const nimvm*: bool = false +{.pop.} proc compileOption*(option: string): bool {. magic: "CompileOption", noSideEffect.} @@ -2544,6 +2546,7 @@ when hostOS == "standalone": include "$projectpath/panicoverride" when not declared(sysFatal): + {.push profiler: off.} when hostOS == "standalone": proc sysFatal(exceptn: typedesc, message: string) {.inline.} = panic(message) @@ -2563,6 +2566,7 @@ when not declared(sysFatal): new(e) e.msg = message & arg raise e + {.pop.} proc getTypeInfo*[T](x: T): pointer {.magic: "GetTypeInfo", benign.} ## get type information for `x`. Ordinary code should not use this, but @@ -2616,8 +2620,10 @@ when not defined(JS): #and not defined(nimscript): when declared(setStackBottom): setStackBottom(locals) + {.push profiler: off.} var strDesc = TNimType(size: sizeof(string), kind: tyString, flags: {ntfAcyclic}) + {.pop.} # ----------------- IO Part ------------------------------------------------ @@ -2950,6 +2956,8 @@ when not defined(JS): #and not defined(nimscript): ## lead to the ``raise`` statement. This only works for debug builds. {.push stack_trace: off, profiler:off.} + when defined(memtracker): + include "system/memtracker" when hostOS == "standalone": include "system/embedded" else: @@ -2992,7 +3000,9 @@ when not defined(JS): #and not defined(nimscript): else: result = n.sons[n.len] + {.push profiler:off.} when hasAlloc: include "system/mmdisp" + {.pop.} {.push stack_trace: off, profiler:off.} when hasAlloc: include "system/sysstr" {.pop.} |