BRL-CAD
#include "common.h"
#include <stdio.h>
#include <math.h>
#include "bu/rb.h"
#include "./rb_internals.h"
Include dependency graph for rb_free.c:

Go to the source code of this file.

Functions

void bu_rb_free (struct bu_rb_tree *tree, void(*free_data)(void *))
 
void rb_free_node (struct bu_rb_node *node)
 
void rb_free_package (struct bu_rb_package *package)
 

Detailed Description

Routines to free a red-black tree

Definition in file rb_free.c.

Function Documentation

void bu_rb_free ( struct bu_rb_tree tree,
void(*)(void *)  free_data 
)
void rb_free_node ( struct bu_rb_node node)

Relinquish memory occupied by a red-black node

This function has one parameter: a node to free. rb_free_node() frees the memory allocated for the various members of the node and then frees the memory allocated for the node itself.

Definition at line 81 of file rb_free.c.

References BU_CKMAG, bu_free(), BU_LIST_DEQUEUE, BU_RB_LIST_MAGIC, BU_RB_NODE_MAGIC, bu_rb_list::l, RB_CURRENT, RB_NULL, bu_rb_node::rbn_color, bu_rb_node::rbn_left, bu_rb_node::rbn_list_pos, bu_rb_node::rbn_package, bu_rb_node::rbn_parent, bu_rb_node::rbn_right, bu_rb_node::rbn_size, and bu_rb_node::rbn_tree.

Referenced by _rb_delete(), and bu_rb_free().

Here is the call graph for this function:

void rb_free_package ( struct bu_rb_package package)

Relinquish memory occupied by a red-black package

This function has one parameter: a package to free. rb_free_package() frees the memory allocated to point to the nodes that contained the package and then frees the memory allocated for the package itself.

Definition at line 111 of file rb_free.c.

References BU_CKMAG, bu_free(), BU_LIST_DEQUEUE, BU_RB_LIST_MAGIC, BU_RB_PKG_MAGIC, bu_rb_list::l, bu_rb_package::rbp_list_pos, and bu_rb_package::rbp_node.

Referenced by bu_rb_delete(), and bu_rb_free().

Here is the call graph for this function: