diff options
author | Timothee Cour <timothee.cour2@gmail.com> | 2021-06-24 02:55:31 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-06-24 11:55:31 +0200 |
commit | 565e07a9936657fa356777eec5f0f52b2d5d7e02 (patch) | |
tree | 3c86289986e78256dd2196ee97d5a6a546566ba5 /lib/std/vmutils.nim | |
parent | 0c8d3ae9852721147ddf878e204c14e949ed676a (diff) | |
download | Nim-565e07a9936657fa356777eec5f0f52b2d5d7e02.tar.gz |
enable VM tracing in user code via `{.define(nimVmTrace).}` (#18244)
* enable VM tracing in user code via `{.define(nimVmTrace).}` * add vmutils.vmTrace * add vmTrace
Diffstat (limited to 'lib/std/vmutils.nim')
-rw-r--r-- | lib/std/vmutils.nim | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/lib/std/vmutils.nim b/lib/std/vmutils.nim new file mode 100644 index 000000000..e16912a3c --- /dev/null +++ b/lib/std/vmutils.nim @@ -0,0 +1,11 @@ +##[ +Experimental API, subject to change. +]## + +proc vmTrace*(on: bool) {.compileTime.} = + runnableExamples: + static: vmTrace(true) + proc fn = + var a = 1 + vmTrace(false) + static: fn() |