21 #ifndef _RTEMS_RBHEAP_H 22 #define _RTEMS_RBHEAP_H 205 static inline void rtems_rbheap_add_to_spare_descriptor_chain(
211 rtems_rbheap_get_spare_descriptor_chain(control);
216 static inline void rtems_rbheap_set_extend_descriptors(
224 static inline void *rtems_rbheap_get_handler_arg(
231 static inline void rtems_rbheap_set_handler_arg(
255 #define rtems_rbheap_chunk_of_node(node) \ 256 RTEMS_CONTAINER_OF(node, rtems_rbheap_chunk, tree_node) rtems_chain_control spare_descriptor_chain
Chain of free chunk descriptors.
Definition: rbheap.h:122
This is used to manage each element (node) which is placed on a chain.
Definition: chain.h:65
uintptr_t begin
Begin address of the chunk.
Definition: rbheap.h:75
rtems_rbtree_control chunk_tree
Tree of chunks representing the state of the managed memory area.
Definition: rbheap.h:127
Red-black heap control.
Definition: rbheap.h:110
This is used to manage a chain.
Definition: chain.h:83
Red-black heap chunk descriptor.
Definition: rbheap.h:54
void rtems_rbheap_extend_descriptors_never(rtems_rbheap_control *control)
Chunk descriptor extend handler that does nothing.
Definition: rbheap.c:265
rtems_chain_node chain_node
This chain node can be used in two chains.
Definition: rbheap.h:63
rtems_status_code rtems_rbheap_initialize(rtems_rbheap_control *control, void *area_begin, uintptr_t area_size, uintptr_t alignment, rtems_rbheap_extend_descriptors extend_descriptors, void *handler_arg)
Initializes the red-black tree heap control.
Definition: rbheap.c:90
rtems_rbtree_node tree_node
Tree node for chunks that represent a part of the managed memory area.
Definition: rbheap.h:69
RTEMS_INLINE_ROUTINE void rtems_chain_prepend_unprotected(rtems_chain_control *the_chain, rtems_chain_node *the_node)
Prepend a node (unprotected).
Definition: chain.h:737
uintptr_t size
Size of the chunk in bytes.
Definition: rbheap.h:80
rtems_status_code
Classic API Status.
Definition: status.h:46
RTEMS_INLINE_ROUTINE bool rtems_chain_is_node_off_chain(const rtems_chain_node *node)
Is the node off chain.
Definition: chain.h:201
void(* rtems_rbheap_extend_descriptors)(rtems_rbheap_control *control)
Handler to extend the available chunk descriptors.
Definition: rbheap.h:105
void * rtems_rbheap_allocate(rtems_rbheap_control *control, size_t size)
Allocates a chunk of memory of at least size bytes from the red-black tree heap control.
Definition: rbheap.c:164
rtems_rbheap_extend_descriptors extend_descriptors
Handler to extend the available chunk descriptors.
Definition: rbheap.h:137
void * handler_arg
User specified argument handler for private handler data.
Definition: rbheap.h:142
This is used to manage a RBT.
Definition: rbtree.h:138
void rtems_rbheap_extend_descriptors_with_malloc(rtems_rbheap_control *control)
Chunk descriptor extend handler that uses malloc().
Definition: rbheap.c:270
Constants and Structures Associated with the RBTree API in RTEMS.
rtems_status_code rtems_rbheap_free(rtems_rbheap_control *control, void *ptr)
Frees a chunk of memory ptr allocated from the red-black tree heap control.
Definition: rbheap.c:238
This is used to manage each element (node) which is placed on a RBT.
Definition: rbtree.h:75
rtems_chain_control free_chunk_chain
Chain of free chunks in the managed memory area.
Definition: rbheap.h:114
uintptr_t alignment
Minimum chunk begin alignment in bytes.
Definition: rbheap.h:132