hopefully a working allocator !
This commit is contained in:
parent
a149e9a860
commit
b639b0c14e
8 changed files with 53 additions and 35 deletions
|
|
@ -81,15 +81,15 @@ t_str node_getstr(t_node *node)
|
|||
return (node->single_str);
|
||||
}
|
||||
|
||||
void free_node(t_node t)
|
||||
void free_node(t_node self)
|
||||
{
|
||||
// t_usize idx;
|
||||
//
|
||||
// idx = 0;
|
||||
// while (idx < t.childs_count)
|
||||
// free_node(t.childs[idx++]);
|
||||
// free(t.childs);
|
||||
// if (t.single_str != NULL)
|
||||
// free(t.single_str);
|
||||
(void)(t);
|
||||
t_usize idx;
|
||||
|
||||
if (self.single_str)
|
||||
me_free(self.single_str);
|
||||
idx = 0;
|
||||
while (idx < self.childs_count)
|
||||
free_node(self.childs[idx++]);
|
||||
if (self.childs_count != 0)
|
||||
me_free(self.childs);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue