From 16c25e1f71113002e2d3e8d01b4e2620ddf0e2dc Mon Sep 17 00:00:00 2001 From: Araq Date: Tue, 16 Feb 2021 23:16:04 +0100 Subject: [PATCH] don't introduce 'dispose', use '=dispose', fixes #17003 [backport:1.4] --- lib/system/arc.nim | 2 +- tests/destructor/tbintree2.nim | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/system/arc.nim b/lib/system/arc.nim index 9ee367543e9e..7f533089c7e8 100644 --- a/lib/system/arc.nim +++ b/lib/system/arc.nim @@ -163,7 +163,7 @@ proc nimRawDispose(p: pointer, alignment: int) {.compilerRtl.} = let hdrSize = align(sizeof(RefHeader), alignment) alignedDealloc(p -! hdrSize, alignment) -template dispose*[T](x: owned(ref T)) = nimRawDispose(cast[pointer](x), T.alignOf) +template `=dispose`*[T](x: owned(ref T)) = nimRawDispose(cast[pointer](x), T.alignOf) #proc dispose*(x: pointer) = nimRawDispose(x) proc nimDestroyAndDispose(p: pointer) {.compilerRtl, raises: [].} = diff --git a/tests/destructor/tbintree2.nim b/tests/destructor/tbintree2.nim index 6fdda6e54667..0bc52457c98d 100644 --- a/tests/destructor/tbintree2.nim +++ b/tests/destructor/tbintree2.nim @@ -57,7 +57,7 @@ proc `=destroy`(t: var Tree) {.nodestroy.} = let x = s.pop if x.left != nil: s.add(x.left) if x.right != nil: s.add(x.right) - dispose(x) + `=dispose`(x) `=destroy`(s) proc hasValue(self: var Tree, x: int32): bool =