mirror of
https://github.com/nim-lang/Nim.git
synced 2025-12-30 01:44:37 +00:00
(cherry picked from commit e463a67c74)
This commit is contained in:
@@ -160,7 +160,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: [].} =
|
||||
|
||||
@@ -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 =
|
||||
|
||||
Reference in New Issue
Block a user