Adds note to quit() about being called for termination.
This commit is contained in:
parent
2b517161e4
commit
c2bc187382
1 changed files with 11 additions and 6 deletions
|
|
@ -909,12 +909,17 @@ var programResult* {.exportc: "nim_program_result".}: int
|
||||||
|
|
||||||
proc quit*(errorcode: int = QuitSuccess) {.
|
proc quit*(errorcode: int = QuitSuccess) {.
|
||||||
magic: "Exit", importc: "exit", noDecl, noReturn.}
|
magic: "Exit", importc: "exit", noDecl, noReturn.}
|
||||||
## stops the program immediately; before stopping the program the
|
## Stops the program immediately with an exit code.
|
||||||
## "quit procedures" are called in the opposite order they were added
|
##
|
||||||
## with ``addQuitProc``. ``quit`` never returns and ignores any
|
## Before stopping the program the "quit procedures" are called in the
|
||||||
## exception that may have been raised by the quit procedures.
|
## opposite order they were added with ``addQuitProc``. ``quit`` never
|
||||||
## It does *not* call the garbage collector to free all the memory,
|
## returns and ignores any exception that may have been raised by the quit
|
||||||
## unless a quit procedure calls ``GC_collect``.
|
## procedures. It does *not* call the garbage collector to free all the
|
||||||
|
## memory, unless a quit procedure calls ``GC_collect``.
|
||||||
|
##
|
||||||
|
## The proc ``quit(QuitSuccess)`` is called implicitly when your nimrod
|
||||||
|
## program finishes without incident. A raised unhandled exception is
|
||||||
|
## equivalent to calling ``quit(QuitFailure)``.
|
||||||
|
|
||||||
template sysAssert(cond: bool, msg: string) =
|
template sysAssert(cond: bool, msg: string) =
|
||||||
when defined(useSysAssert):
|
when defined(useSysAssert):
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue