This commit is contained in:
parent
81703d4ad4
commit
e463a67c74
2 changed files with 2 additions and 2 deletions
|
|
@ -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: [].} =
|
||||
|
|
|
|||
|
|
@ -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 =
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue