diff options
author | Andreas Rumpf <rumpf_a@web.de> | 2020-03-18 16:57:34 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-03-18 16:57:34 +0100 |
commit | fb641483f0e2ed974b89d629ea5ec28e5e6145ce (patch) | |
tree | 8f74544adb04d46a7946554e2fd73e6bbc417ff3 /lib/system.nim | |
parent | a96842aaeb46ddf3990f9632259a26cb451c5b80 (diff) | |
download | Nim-fb641483f0e2ed974b89d629ea5ec28e5e6145ce.tar.gz |
arc optimizations (#13325)
* scope based destructors * handle 'or' and 'and' expressions properly, see the new test arc/tcontrolflow.nim * make this branch mergable, logic is disabled for now
Diffstat (limited to 'lib/system.nim')
-rw-r--r-- | lib/system.nim | 9 |
1 files changed, 1 insertions, 8 deletions
diff --git a/lib/system.nim b/lib/system.nim index 602fbc1f1..cd941b19f 100644 --- a/lib/system.nim +++ b/lib/system.nim @@ -1954,14 +1954,7 @@ template newException*(exceptn: typedesc, message: string; parentException: ref Exception = nil): untyped = ## Creates an exception object of type ``exceptn`` and sets its ``msg`` field ## to `message`. Returns the new exception object. - when declared(owned): - var e: owned(ref exceptn) - else: - var e: ref exceptn - new(e) - e.msg = message - e.parent = parentException - e + (ref exceptn)(msg: message, parent: parentException) when hostOS == "standalone" and defined(nogc): proc nimToCStringConv(s: NimString): cstring {.compilerproc, inline.} = |