Commit 3616d98b authored by Nils Goroll's avatar Nils Goroll

split out fini from free

parent c7ef2f41
......@@ -469,19 +469,9 @@ node_alloc(void)
return (node);
}
/* recursively free all nodes == free the tree */
static void
node_free(struct req *req, struct node *node)
node_fini(struct req *req, struct node *node)
{
struct node *child, *tmp;
AN(mempool);
MPL_AssertSane(node);
if (node->type == T_NEXUS)
VSTAILQ_FOREACH_SAFE(child, &node->nexus.children, sibling, tmp)
node_free(req, child);
switch (node->type) {
case T_FINAL:
fini_final(req, node);
......@@ -503,7 +493,22 @@ node_free(struct req *req, struct node *node)
default:
INCOMPL();
}
}
/* recursively free all nodes == free the tree */
static void
node_free(struct req *req, struct node *node)
{
struct node *child, *tmp;
AN(mempool);
MPL_AssertSane(node);
if (node->type == T_NEXUS)
VSTAILQ_FOREACH_SAFE(child, &node->nexus.children, sibling, tmp)
node_free(req, child);
node_fini(req, node);
MPL_Free(mempool, node);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment