FreeBSD/sys/kern/subr_pctrie.c
/*
 * Remove and free all the nodes from the tree.
 * This function is recursive but there is a tight control on it as the
 * maximum depth of the tree is fixed.
 */
Remove and free all the nodes from the tree.
This function is recursive but there is a tight control on it as the
maximum depth of the tree is fixed.
Remove and free all the nodes from the tree . This function is recursive but there is a tight control on it as the maximum depth of the tree is fixed .
void
pctrie_reclaim_allnodes(struct pctrie *ptree, pctrie_free_t freefn)
{
	struct pctrie_node *root;
	root = pctrie_getroot(ptree);
	if (root == NULL)
		return;
	pctrie_setroot(ptree, NULL);
	if (!pctrie_isleaf(root))
		pctrie_reclaim_allnodes_int(ptree, root, freefn);
}
void pctrie_reclaim_allnodes ( struct pctrie * ptree , pctrie_free_t freefn ) { struct pctrie_node * root ; root = pctrie_getroot ( ptree ) ; if ( root == NULL ) return ; pctrie_setroot ( ptree , NULL ) ; if ( ! pctrie_isleaf ( root ) ) pctrie_reclaim_allnodes_int ( ptree , root , freefn ) ; }
Remove and free all the nodes from the tree.
Remove and free all the nodes from the tree .