author | Sebastian Harl <sh@tokkee.org> | |
Fri, 11 Jul 2014 15:42:33 +0000 (17:42 +0200) | ||
committer | Sebastian Harl <sh@tokkee.org> | |
Fri, 11 Jul 2014 15:42:33 +0000 (17:42 +0200) | ||
commit | be24944a8a24aca28b54dafb6a1385507e5ca67c | |
tree | 16ddd4d7b371c07e472548787cda32ddb329a591 | tree | snapshot |
parent | 055e6f2b7fea04f00ed3783e22344c7340b54c78 | commit | diff |
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.
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 | diff | blob | history |