diff -r 14ca894190fd -r b642eca4b956 src/cx/tree.h --- a/src/cx/tree.h Tue Nov 26 22:00:03 2024 +0100 +++ b/src/cx/tree.h Tue Nov 26 22:16:27 2024 +0100 @@ -883,7 +883,7 @@ * the advanced destructor, starting with the leaf nodes of the subtree. * * When this function is invoked on the root node of the tree, it destroys the - * tree contents, but - in contrast to #cxTreeDestroy() - not the tree + * tree contents, but - in contrast to #cxTreeFree() - not the tree * structure, leaving an empty tree behind. * * \note The destructor function, if any, will \em not be invoked. That means @@ -895,7 +895,7 @@ * * @param tree the tree * @param node the node to remove - * @see cxTreeDestroy() + * @see cxTreeFree() */ cx_attr_nonnull void cxTreeDestroySubtree(CxTree *tree, void *node); @@ -921,7 +921,7 @@ #define cxTreeClear(tree) cxTreeDestroySubtree(tree, tree->root) /** - * Destroys the tree structure. + * Deallocates the tree structure. * * The destructor functions are invoked for each node, starting with the leaf * nodes. @@ -934,9 +934,9 @@ * that would cause a double-free in most scenarios where the advanced * destructor is already freeing the memory. * - * @param tree the tree to destroy + * @param tree the tree to free */ -static inline void cxTreeDestroy(CxTree *tree) { +static inline void cxTreeFree(CxTree *tree) { if (tree == NULL) return; if (tree->root != NULL) { cxTreeClear(tree); @@ -971,7 +971,7 @@ cx_attr_nonnull_arg(2, 3, 4) cx_attr_nodiscard cx_attr_malloc -cx_attr_dealloc(cxTreeDestroy, 1) +cx_attr_dealloc(cxTreeFree, 1) CxTree *cxTreeCreate( const CxAllocator *allocator, cx_tree_node_create_func create_func, @@ -1031,7 +1031,7 @@ cx_attr_nonnull_arg(2) cx_attr_nodiscard cx_attr_malloc -cx_attr_dealloc(cxTreeDestroy, 1) +cx_attr_dealloc(cxTreeFree, 1) CxTree *cxTreeCreateWrapped( const CxAllocator *allocator, void *root,