summary refs log tree commit diff stats
path: root/lib
diff options
context:
space:
mode:
authorAraq <rumpf_a@web.de>2019-07-09 19:53:23 +0200
committerAraq <rumpf_a@web.de>2019-07-09 20:15:57 +0200
commitad58ed344a50fca81bcf72c43f02921fdbba6b30 (patch)
tree2459be35eb99bb30b442a98621da0e96d12e67d3 /lib
parenteb059fa8488041fcde8fda761a4634aaeecc4ce1 (diff)
downloadNim-ad58ed344a50fca81bcf72c43f02921fdbba6b30.tar.gz
newruntime: map system.reset to =destroy
Diffstat (limited to 'lib')
-rw-r--r--lib/system.nim12
1 files changed, 10 insertions, 2 deletions
diff --git a/lib/system.nim b/lib/system.nim
index 45ee5be0b..72d1a3aee 100644
--- a/lib/system.nim
+++ b/lib/system.nim
@@ -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