newruntime: map system.reset to =destroy
This commit is contained in:
parent
eb059fa848
commit
ad58ed344a
1 changed files with 10 additions and 2 deletions
|
|
@ -264,8 +264,16 @@ proc new*[T](a: var ref T, finalizer: proc (x: ref T) {.nimcall.}) {.
|
|||
## **Note**: The `finalizer` refers to the type `T`, not to the object!
|
||||
## This means that for each object of type `T` the finalizer will be called!
|
||||
|
||||
proc reset*[T](obj: var T) {.magic: "Reset", noSideEffect.}
|
||||
## Resets an object `obj` to its initial (binary zero) value.
|
||||
when defined(nimV2):
|
||||
proc reset*[T](obj: var T) {.magic: "Destroy", noSideEffect.}
|
||||
## Old runtime target: Resets an object `obj` to its initial (binary zero) value.
|
||||
##
|
||||
## New runtime target: An alias for `=destroy`.
|
||||
else:
|
||||
proc reset*[T](obj: var T) {.magic: "Reset", noSideEffect.}
|
||||
## Old runtime target: Resets an object `obj` to its initial (binary zero) value.
|
||||
##
|
||||
## New runtime target: An alias for `=destroy`.
|
||||
|
||||
proc wasMoved*[T](obj: var T) {.magic: "WasMoved", noSideEffect.} =
|
||||
## Resets an object `obj` to its initial (binary zero) value to signify
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue