|
LibJuno 0.42.0
LibJuno is a lightweight C99 library designed specifically for embedded systems.
|


Go to the source code of this file.
Macros | |
| #define | JUNO_MEMORY_BLOCK(name, type, length) static type name[length] = {0} |
| Macro to declare a static memory block and its associated free stack. | |
| #define | JUNO_MEMORY_BLOCK_METADATA(name, length) static JUNO_MEMORY_BLOCK_METADATA_T name[length] = {0} |
| Macro to declare a static array for memory metadata. | |
Typedefs | |
| typedef struct JUNO_MEMORY_BLOCK_METADATA_TAG | JUNO_MEMORY_BLOCK_METADATA_T |
| typedef struct JUNO_MEMORY_BLOCK_TAG | JUNO_MEMORY_BLOCK_T |
| typedef struct JUNO_MEMORY_ALLOC_BLOCK_TAG | JUNO_MEMORY_ALLOC_BLOCK_T |
Functions | |
| struct JUNO_MEMORY_ALLOC_BLOCK_TAG | JUNO_MODULE_DERIVE (JUNO_MEMORY_ALLOC_ROOT_T, uint8_t *pvMemory;JUNO_MEMORY_BLOCK_METADATA_T *ptMetadata;size_t zTypeSize;size_t zLength;size_t zUsed;size_t zFreed;) |
| union JUNO_MEMORY_ALLOC_TAG | JUNO_MODULE (JUNO_MEMORY_ALLOC_API_T, JUNO_MEMORY_ALLOC_ROOT_T, JUNO_MEMORY_ALLOC_BLOCK_T tJunoMemoryBlock;) |
| JUNO_STATUS_T | JunoMemory_BlockApi (JUNO_MEMORY_ALLOC_T *ptJunoMemory, void *pvMemory, JUNO_MEMORY_BLOCK_METADATA_T *ptMetadata, size_t zTypeSize, size_t zLength, JUNO_FAILURE_HANDLER_T pfcnFailureHandler, JUNO_USER_DATA_T *pvFailureUserData) |
| Initializes a memory block for allocation. Sets up a memory block with an associated free stack for managing fixed-size allocations. | |
| #define JUNO_MEMORY_BLOCK | ( | name, | |
| type, | |||
| length | |||
| ) | static type name[length] = {0} |
Macro to declare a static memory block and its associated free stack.
This API has been generated by LibJuno: https://www.robinonsay.com/libjuno/ This header contains the juno_memory block blockementation
| name | Name of the memory block. |
| type | Data type of each block element. |
| length | Number of elements in the memory block. |
| #define JUNO_MEMORY_BLOCK_METADATA | ( | name, | |
| length | |||
| ) | static JUNO_MEMORY_BLOCK_METADATA_T name[length] = {0} |
Macro to declare a static array for memory metadata.
| name | Name of the metadata array. |
| length | Number of metadata entries. |
| typedef struct JUNO_MEMORY_ALLOC_BLOCK_TAG JUNO_MEMORY_ALLOC_BLOCK_T |
| typedef struct JUNO_MEMORY_BLOCK_METADATA_TAG JUNO_MEMORY_BLOCK_METADATA_T |
| typedef struct JUNO_MEMORY_BLOCK_TAG JUNO_MEMORY_BLOCK_T |
| union JUNO_MEMORY_ALLOC_TAG JUNO_MODULE | ( | JUNO_MEMORY_ALLOC_API_T | , |
| JUNO_MEMORY_ALLOC_ROOT_T | , | ||
| JUNO_MEMORY_ALLOC_BLOCK_T tJunoMemoryBlock; | |||
| ) |
This is the default blockementation for JUNO_MEMORY_T. If you want to derive new blockementations for JUNO_MEMORY_T use #define JUNO_MEMORY_DERIVED prior to including #include "juno_memory_block.h"
Note: If you are blockementing a derived module you will need to blockement JUNO_MEMORY_BLOCK.
| struct JUNO_MEMORY_ALLOC_BLOCK_TAG JUNO_MODULE_DERIVE | ( | JUNO_MEMORY_ALLOC_ROOT_T | , |
| uint8_t *pvMemory;JUNO_MEMORY_BLOCK_METADATA_T *ptMetadata;size_t zTypeSize;size_t zLength;size_t zUsed;size_t zFreed; | |||
| ) |
| JUNO_STATUS_T JunoMemory_BlockApi | ( | JUNO_MEMORY_ALLOC_T * | ptJunoMemory, |
| void * | pvMemory, | ||
| JUNO_MEMORY_BLOCK_METADATA_T * | ptMetadata, | ||
| size_t | zTypeSize, | ||
| size_t | zLength, | ||
| JUNO_FAILURE_HANDLER_T | pfcnFailureHandler, | ||
| JUNO_USER_DATA_T * | pvFailureUserData | ||
| ) |
Initializes a memory block for allocation. Sets up a memory block with an associated free stack for managing fixed-size allocations.
| ptMemBlk | Pointer to the memory block structure to initialize. |
| pvMemory | Pointer to the contiguous memory used for allocations. |
| pvMetadata | Pointer to an array for block metadata tracking. |
| zTypeSize | Size in bytes of each element in the block. |
| zLength | Total number of possible allocations. |
| pfcnFailureHandler | Callback function to handle failures. |
| pvUserData | User data passed to the failure handler. |