improvements to memtracking
This commit is contained in:
parent
303c49b9f3
commit
05a3c1b10a
5 changed files with 38 additions and 16 deletions
|
|
@ -56,8 +56,14 @@ proc add(a: var MemRegion, t: var PAvlNode, key, upperBound: int) {.benign.} =
|
|||
t = allocAvlNode(a, key, upperBound)
|
||||
else:
|
||||
if key <% t.key:
|
||||
when defined(avlcorruption):
|
||||
if t.link[0] == nil:
|
||||
cprintf("bug here %p\n", t)
|
||||
add(a, t.link[0], key, upperBound)
|
||||
elif key >% t.key:
|
||||
when defined(avlcorruption):
|
||||
if t.link[1] == nil:
|
||||
cprintf("bug here B %p\n", t)
|
||||
add(a, t.link[1], key, upperBound)
|
||||
else:
|
||||
sysAssert false, "key already exists"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue