LibJuno 0.42.0
LibJuno is a lightweight C99 library designed specifically for embedded systems.
Loading...
Searching...
No Matches
juno_memory_block.c File Reference
#include "juno/memory/memory_block.h"
#include "juno/macros.h"
#include "juno/status.h"
#include "juno/memory/memory_api.h"
#include <stddef.h>
#include <stdint.h>
Include dependency graph for juno_memory_block.c:

Functions

static JUNO_STATUS_T Verify (JUNO_MEMORY_ALLOC_T *ptJunoMemory)
 
static JUNO_STATUS_T Juno_MemoryBlkGet (JUNO_MEMORY_ALLOC_T *ptJunoMemory, JUNO_MEMORY_T *ptMemory, size_t zSize)
 
static JUNO_STATUS_T Juno_MemoryBlkUpdate (JUNO_MEMORY_ALLOC_T *ptJunoMemory, JUNO_MEMORY_T *ptMemory, size_t zNewSize)
 
static JUNO_STATUS_T Juno_MemoryBlkPut (JUNO_MEMORY_ALLOC_T *ptJunoMemory, JUNO_MEMORY_T *ptMemory)
 
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.
 

Variables

static const JUNO_MEMORY_ALLOC_API_T tJunoMemoryBlockApi
 

Function Documentation

◆ Juno_MemoryBlkGet()

static JUNO_STATUS_T Juno_MemoryBlkGet ( JUNO_MEMORY_ALLOC_T ptJunoMemory,
JUNO_MEMORY_T ptMemory,
size_t  zSize 
)
static

◆ Juno_MemoryBlkPut()

static JUNO_STATUS_T Juno_MemoryBlkPut ( JUNO_MEMORY_ALLOC_T ptJunoMemory,
JUNO_MEMORY_T ptMemory 
)
static

◆ Juno_MemoryBlkUpdate()

static JUNO_STATUS_T Juno_MemoryBlkUpdate ( JUNO_MEMORY_ALLOC_T ptJunoMemory,
JUNO_MEMORY_T ptMemory,
size_t  zNewSize 
)
static

◆ 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.

◆ Verify()

static JUNO_STATUS_T Verify ( JUNO_MEMORY_ALLOC_T ptJunoMemory)
inlinestatic

Variable Documentation

◆ tJunoMemoryBlockApi

static const JUNO_MEMORY_ALLOC_API_T tJunoMemoryBlockApi
static
Initial value:
= {
}
static JUNO_STATUS_T Juno_MemoryBlkGet(JUNO_MEMORY_ALLOC_T *ptJunoMemory, JUNO_MEMORY_T *ptMemory, size_t zSize)
Definition juno_memory_block.c:48
static JUNO_STATUS_T Juno_MemoryBlkPut(JUNO_MEMORY_ALLOC_T *ptJunoMemory, JUNO_MEMORY_T *ptMemory)
Definition juno_memory_block.c:121
static JUNO_STATUS_T Juno_MemoryBlkUpdate(JUNO_MEMORY_ALLOC_T *ptJunoMemory, JUNO_MEMORY_T *ptMemory, size_t zNewSize)
Definition juno_memory_block.c:104