sysasserts leaner again
This commit is contained in:
parent
23340695d0
commit
40881a4140
1 changed files with 1 additions and 7 deletions
|
|
@ -835,16 +835,10 @@ proc quit*(errorcode: int = QuitSuccess) {.
|
||||||
## It does *not* call the garbage collector to free all the memory,
|
## It does *not* call the garbage collector to free all the memory,
|
||||||
## unless a quit procedure calls ``GC_collect``.
|
## unless a quit procedure calls ``GC_collect``.
|
||||||
|
|
||||||
proc WriteStackTrace()
|
|
||||||
|
|
||||||
var checkDisabled: bool
|
|
||||||
|
|
||||||
template sysAssert(cond, msg: expr) =
|
template sysAssert(cond, msg: expr) =
|
||||||
when defined(useSysAssert):
|
when defined(useSysAssert):
|
||||||
if not checkDisabled and not cond:
|
if not cond:
|
||||||
checkDisabled = true
|
|
||||||
echo "[SYSASSERT] ", msg
|
echo "[SYSASSERT] ", msg
|
||||||
WriteStackTrace()
|
|
||||||
quit 1
|
quit 1
|
||||||
nil
|
nil
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue