LibJuno 0.22.0
LibJuno is a lightweight C99 library designed specifically for embedded systems.
Loading...
Searching...
No Matches
memory_block.h File Reference
#include "juno/module.h"
#include "juno/status.h"
#include "juno/memory/memory_api.h"
Include dependency graph for memory_block.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

 JUNO_MODULE_DERIVE_DECLARE (JUNO_MEMORY_ALLOC_BLOCK_T)
 
 JUNO_MODULE_DERIVE (JUNO_MEMORY_ALLOC_BLOCK_T, JUNO_MEMORY_ALLOC_BASE_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.
 

Function Documentation

◆ JUNO_MODULE_DERIVE()

JUNO_MODULE_DERIVE ( JUNO_MEMORY_ALLOC_BLOCK_T  ,
JUNO_MEMORY_ALLOC_BASE_T  ,
uint8_t *pvMemory;JUNO_MEMORY_BLOCK_METADATA_T *ptMetadata;size_t zTypeSize;size_t zLength;size_t zUsed;size_t zFreed;   
)

◆ JUNO_MODULE_DERIVE_DECLARE()

JUNO_MODULE_DERIVE_DECLARE ( JUNO_MEMORY_ALLOC_BLOCK_T  )

This API has been generated by LibJuno: https://www.robinonsay.com/libjuno/ This header contains the juno_memory block blockementation

Author

◆ JunoMemory_BlockApi()

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.

Parameters
ptMemBlkPointer to the memory block structure to initialize.
pvMemoryPointer to the contiguous memory used for allocations.
pvMetadataPointer to an array for block metadata tracking.
zTypeSizeSize in bytes of each element in the block.
zLengthTotal number of possible allocations.
pfcnFailureHandlerCallback function to handle failures.
pvUserDataUser data passed to the failure handler.
Returns
JUNO_STATUS_T Status of the initialization.