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
This commit is contained in:
parent
a96842aaeb
commit
fb641483f0
11 changed files with 312 additions and 95 deletions
|
|
@ -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.} =
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue