Function bstree_element_space

Function Documentation

static inline size_t bstree_element_space(size_t max_elts, size_t elt_size)

Calculate the # of bytes that the BST will require if RCSW_NOALLOC_DATA is passed to manage a specified # of elements of a specified size.

The +2 is for the root and nil nodes.

Parameters:
  • max_elts – # of desired elements the BST will hold

  • elt_size – size of elements in bytes

Returns:

The total # of bytes the application would need to allocate