From a9c7529dcca845d98192ece62be70f752972216b Mon Sep 17 00:00:00 2001 From: Marvin Borner Date: Wed, 13 May 2020 21:28:56 +0200 Subject: Replaced alloc.h with liballoc And many more adaptions to the lib --- src/kernel/lib/data/tree.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'src/kernel/lib/data/tree.c') diff --git a/src/kernel/lib/data/tree.c b/src/kernel/lib/data/tree.c index 65b8433..9758ec1 100644 --- a/src/kernel/lib/data/tree.c +++ b/src/kernel/lib/data/tree.c @@ -1,15 +1,16 @@ #include #include +#include #include struct tree *tree_create() { - return (struct tree *)kcalloc(sizeof(struct tree), 1); + return (struct tree *)calloc(sizeof(struct tree), 1); } struct tree_node *treenode_create(void *value) { - struct tree_node *n = kcalloc(sizeof(struct tree_node), 1); + struct tree_node *n = calloc(sizeof(struct tree_node), 1); n->value = value; n->children = list_create(); return n; @@ -17,7 +18,7 @@ struct tree_node *treenode_create(void *value) struct tree_node *tree_insert(struct tree *tree, struct tree_node *subroot, void *value) { - struct tree_node *treenode = kcalloc(sizeof(struct tree_node), 1); + struct tree_node *treenode = calloc(sizeof(struct tree_node), 1); treenode->children = list_create(); treenode->value = value; @@ -62,7 +63,7 @@ void tree_remove(struct tree *tree, struct tree_node *remove_node) struct tree_node *parent = tree_find_parent(tree, remove_node, &child_index); if (parent != NULL) { struct tree_node *freethis = list_remove_by_index(parent->children, child_index); - kfree(freethis); + free(freethis); } } -- cgit v1.2.3