LibJuno 0.1.0
LibJuno is a lightweight C99 library designed specifically for embedded systems.
Loading...
Searching...
No Matches
memory.h
Go to the documentation of this file.
1#ifndef JUNO_MEMORY_DIRECT_H
2#define JUNO_MEMORY_DIRECT_H
3
6#include "juno/status.h"
7#include <stddef.h>
8#include <stdint.h>
9
10#ifdef __cplusplus
11extern "C" {
12#endif
13
25 JUNO_MEMORY_BLOCK_T *ptMemBlk,
26 void *pvMemory,
28 size_t zTypeSize,
29 size_t zLength,
30 JUNO_FAILURE_HANDLER_T pfcnFailureHandler,
31 JUNO_USER_DATA_T *pvUserData
32);
33
39JUNO_STATUS_T Juno_MemoryGet(JUNO_MEMORY_ALLOC_T *ptMem, JUNO_MEMORY_T *ptMemory, size_t zSize);
40
46JUNO_STATUS_T Juno_MemoryUpdate(JUNO_MEMORY_ALLOC_T *ptMem, JUNO_MEMORY_T *ptMemory, size_t zNewSize);
47
54
55
59
60
61
62#ifdef __cplusplus
63}
64#endif
65#endif
const JUNO_MEMORY_API_T * Juno_MemoryApi(void)
Retrieves the generic memory API structure.
Definition juno_memory.c:283
JUNO_STATUS_T Juno_MemoryGet(JUNO_MEMORY_ALLOC_T *ptMem, JUNO_MEMORY_T *ptMemory, size_t zSize)
Generic memory allocation function. Allocates memory by using the appropriate allocation method based...
Definition juno_memory.c:193
JUNO_STATUS_T Juno_MemoryPut(JUNO_MEMORY_ALLOC_T *ptMem, JUNO_MEMORY_T *ptMemory)
Generic memory free function. Releases memory back to the allocator and clears the memory descriptor.
Definition juno_memory.c:234
JUNO_STATUS_T Juno_MemoryUpdate(JUNO_MEMORY_ALLOC_T *ptMem, JUNO_MEMORY_T *ptMemory, size_t zNewSize)
Updates the current memory allocation to a new size (realloc).
Definition juno_memory.c:172
JUNO_STATUS_T Juno_MemoryBlkInit(JUNO_MEMORY_BLOCK_T *ptMemBlk, void *pvMemory, JUNO_MEMORY_BLOCK_METADATA_T *pvMetadata, size_t zTypeSize, size_t zLength, JUNO_FAILURE_HANDLER_T pfcnFailureHandler, JUNO_USER_DATA_T *pvUserData)
Initializes a memory block for allocation. Sets up a memory block with an associated free stack for m...
Definition juno_memory.c:32
void(* JUNO_FAILURE_HANDLER_T)(JUNO_STATUS_T tStatus, const char *pcCustomMessage, JUNO_USER_DATA_T *pvUserData)
Definition status.h:26
enum JUNO_STATUS_TAG JUNO_STATUS_T
void JUNO_USER_DATA_T
Definition status.h:25
API for generic memory allocation operations.
Definition memory_api.h:19
Definition memory_types.h:46
Structure representing a block-based memory allocator. Manages a fixed-size memory area along with as...
Definition memory_types.h:74
Structure for an allocated memory segment. Describes the allocated memory with a pointer to the start...
Definition memory_types.h:60
Union for a generic memory allocation. Accommodates various allocation types, currently including blo...
Definition memory_types.h:89