This group contains the Freechain Handler implementation.
More...
|
|
typedef void *(* | Freechain_Allocator) (size_t size) |
| | Allocator function.
|
| |
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.
◆ _Freechain_Extend()
Extend the freechain with new nodes.
- Parameters
-
| freechain | The freechain control. |
| allocator | The allocator function. |
| number_nodes_to_extend | The number of nodes to extend. |
| node_size | The node size. |
- Return values
-
| NULL | The extend operation failed. |
| nodes | Pointer to the new nodes. |
◆ _Freechain_Get()
Gets a node from the freechain.
- Parameters
-
| [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. |
- Return values
-
| NULL | The freechain is empty and the extend operation failed. |
| pointer | Pointer to a node. The node ownership passes to the caller. |
◆ _Freechain_Put()
Puts a node back onto the freechain.
- Parameters
-
| [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. |