17#define JUNO_MEMORY_BLOCK(name, type, length) \
18static type name[length] = {};
23#define JUNO_MEMORY_BLOCK_METADATA(name, length) \
24static JUNO_MEMORY_BLOCK_METADATA_T name[length] = {};
26#define JUNO_REF(name) REF##name
27#define JUNO_NEW_REF(name) JUNO_MEMORY_T *JUNO_REF(name)
34#ifndef JUNO_CUSTOM_ALLOC
85#ifndef JUNO_CUSTOM_ALLOC
enum JUNO_MEMORY_ALLOC_TYPE_TAG JUNO_MEMORY_ALLOC_TYPE_T
Enumeration of memory allocation types.
JUNO_MEMORY_ALLOC_TYPE_TAG
Enumeration of memory allocation types.
Definition memory_types.h:40
@ JUNO_MEMORY_ALLOC_TYPE_BLOCK
Block-based memory allocation.
Definition memory_types.h:42
@ JUNO_MEMORY_ALLOC_TYPE_RESERVED
Reserved allocation type.
Definition memory_types.h:41
Structure for memory allocation header. Contains general information including the type of allocation...
Definition memory_types.h:53
JUNO_MEMORY_ALLOC_TYPE_T tType
Type of memory allocation.
Definition memory_types.h:54
Structure representing a block-based memory allocator. Manages a fixed-size memory area along with as...
Definition memory_types.h:74
size_t zTypeSize
Size of each block element.
Definition memory_types.h:78
size_t zLength
Total number of blocks available.
Definition memory_types.h:79
DECLARE_FAILURE_HANDLER
Macro to declare a failure handler.
Definition memory_types.h:82
uint8_t * pvMemory
Pointer to the allocated memory area.
Definition memory_types.h:76
size_t zFreed
Current count of freed blocks in the free stack.
Definition memory_types.h:81
JUNO_MEMORY_BLOCK_METADATA_T * ptMetadata
Array of metadata for each block.
Definition memory_types.h:77
size_t zUsed
Current count of allocated blocks.
Definition memory_types.h:80
JUNO_MEMORY_ALLOC_HDR_T tHdr
Header indicating the allocation type.
Definition memory_types.h:75
Structure for an allocated memory segment. Describes the allocated memory with a pointer to the start...
Definition memory_types.h:60
void * pvAddr
Pointer to the allocated memory.
Definition memory_types.h:62
size_t iRefCount
The reference count for this memory.
Definition memory_types.h:66
size_t zSize
Size of the allocated memory, in bytes.
Definition memory_types.h:64
Union for a generic memory allocation. Accommodates various allocation types, currently including blo...
Definition memory_types.h:89
JUNO_MEMORY_BLOCK_T tBlock
Block-based allocation structure.
Definition memory_types.h:91
JUNO_MEMORY_ALLOC_HDR_T tHdr
Common header for any allocation type.
Definition memory_types.h:90