Code

avltree: Iterate through the tree depth-first when clearing it.
authorSebastian Harl <sh@tokkee.org>
Fri, 11 Jul 2014 15:42:33 +0000 (17:42 +0200)
committerSebastian Harl <sh@tokkee.org>
Fri, 11 Jul 2014 15:42:33 +0000 (17:42 +0200)
commitbe24944a8a24aca28b54dafb6a1385507e5ca67c
tree16ddd4d7b371c07e472548787cda32ddb329a591
parent055e6f2b7fea04f00ed3783e22344c7340b54c78
avltree: Iterate through the tree depth-first when clearing it.

Else, we cannot simple delete each node but we'd have to actually remove it
from the tree because we'd be removing non-leaf nodes.

Don't use recursion for iterating the tree. It's not needed and would
consume stack-space unnecessarily. The current approach limits the size of the
tree by heap memory only.
src/utils/avltree.c