36#ifndef _RTEMS_RBHEAP_H
37#define _RTEMS_RBHEAP_H
218 return &
control->spare_descriptor_chain;
221static inline void rtems_rbheap_add_to_spare_descriptor_chain(
227 rtems_rbheap_get_spare_descriptor_chain(
control);
229 rtems_chain_initialize_node(&chunk->
chain_node);
230 rtems_chain_prepend_unprotected(chain, &chunk->
chain_node);
233static inline void rtems_rbheap_set_extend_descriptors(
238 control->extend_descriptors = extend_descriptors;
241static inline void *rtems_rbheap_get_handler_arg(
248static inline void rtems_rbheap_set_handler_arg(
253 control->handler_arg = handler_arg;
272#define rtems_rbheap_chunk_of_node(node) \
273 RTEMS_CONTAINER_OF(node, rtems_rbheap_chunk, tree_node)
277 return !rtems_chain_is_node_off_chain(&chunk->
chain_node);
This header file provides the Chains API.
rtems_status_code
This enumeration provides status codes for directives of the Classic API.
Definition: status.h:85
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:107
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:259
void rtems_rbheap_extend_descriptors_never(rtems_rbheap_control *control)
Chunk descriptor extend handler that does nothing.
Definition: rbheap.c:286
void(* rtems_rbheap_extend_descriptors)(rtems_rbheap_control *control)
Handler to extend the available chunk descriptors.
Definition: rbheap.h:121
void rtems_rbheap_extend_descriptors_with_malloc(rtems_rbheap_control *control)
Chunk descriptor extend handler that uses malloc().
Definition: rbheap.c:291
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:181
RBTree_Control rtems_rbtree_control
Definition: rbtree.h:72
This header file provides the Red-Black Trees API.
This header file defines the RTEMS Classic API.
This structure represents a chain node.
Definition: chain.h:78
Red-black tree node.
Definition: rbtree.h:73
Definition: intercom.c:87
Red-black heap chunk descriptor.
Definition: rbheap.h:70
uintptr_t size
Definition: rbheap.h:96
rtems_chain_node chain_node
Definition: rbheap.h:79
uintptr_t begin
Definition: rbheap.h:91
rtems_rbtree_node tree_node
Definition: rbheap.h:85
Red-black heap control.
Definition: rbheap.h:126
rtems_chain_control spare_descriptor_chain
Definition: rbheap.h:138
rtems_chain_control free_chunk_chain
Definition: rbheap.h:130
uintptr_t alignment
Definition: rbheap.h:148
rtems_rbheap_extend_descriptors extend_descriptors
Definition: rbheap.h:153
rtems_rbtree_control chunk_tree
Definition: rbheap.h:143
void * handler_arg
Definition: rbheap.h:158
This union represents a chain control block.
Definition: chain.h:96