![]() |
RTEMS 6.3
|
This group contains the Freechain Handler implementation. More...
Files | |
| file | cpukit/include/rtems/score/freechain.h |
| This header file provides interfaces of the Freechain Handler which are used by the implementation and the Application Configuration. | |
| file | cpukit/include/rtems/score/freechainimpl.h |
| This header file provides interfaces of the Barrier Handler which are only used by the implementation. | |
| file | cpukit/score/src/freechain.c |
| This source file contains the implementation of _Freechain_Extend(), _Freechain_Get(), and _Freechain_Put(). | |
Data Structures | |
| struct | Freechain_Control |
| The freechain control. More... | |
Typedefs | |
| typedef void *(*) | Freechain_Allocator(size_t size) |
| Allocator function. | |
Functions | |
| void * | _Freechain_Extend (Freechain_Control *freechain, Freechain_Allocator allocator, size_t number_nodes_to_extend, size_t node_size) |
| Extend the freechain with new nodes. | |
| void * | _Freechain_Get (Freechain_Control *freechain, Freechain_Allocator allocator, size_t number_nodes_to_extend, size_t node_size) |
| Gets a node from the freechain. | |
| void | _Freechain_Put (Freechain_Control *freechain, void *node) |
| Puts a node back onto the freechain. | |
This group contains the Freechain Handler implementation.
This handler encapsulates functionality related to the management of free nodes of a user-defined size. If the chain of free nodes is empty during an allocation request, it can be dynamically extended.
| void * _Freechain_Extend | ( | Freechain_Control * | freechain, |
| Freechain_Allocator | allocator, | ||
| size_t | number_nodes_to_extend, | ||
| size_t | node_size ) |
Extend the freechain with new nodes.
| freechain | The freechain control. |
| allocator | The allocator function. |
| number_nodes_to_extend | The number of nodes to extend. |
| node_size | The node size. |
| NULL | The extend operation failed. |
| nodes | Pointer to the new nodes. |
| void * _Freechain_Get | ( | Freechain_Control * | freechain, |
| Freechain_Allocator | allocator, | ||
| size_t | number_nodes_to_extend, | ||
| size_t | node_size ) |
Gets a node from the freechain.
| [in,out] | freechain | The freechain control. |
| allocator | The allocator function. | |
| number_nodes_to_extend | The number of nodes in the case an extend is necessary due to an empty freechain. | |
| [in] | node_size | The node size. |
| NULL | The freechain is empty and the extend operation failed. |
| pointer | Pointer to a node. The node ownership passes to the caller. |
| void _Freechain_Put | ( | Freechain_Control * | freechain, |
| void * | node ) |
Puts a node back onto the freechain.
| [in,out] | freechain | The freechain control. |
| [out] | node | The node to put back. The node may be NULL, in this case the function does nothing. |