From ad58ed344a50fca81bcf72c43f02921fdbba6b30 Mon Sep 17 00:00:00 2001 From: Araq Date: Tue, 9 Jul 2019 19:53:23 +0200 Subject: [PATCH] newruntime: map system.reset to =destroy --- lib/system.nim | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/lib/system.nim b/lib/system.nim index 45ee5be0b2..72d1a3aeee 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