LibJuno 0.1.0
LibJuno is a lightweight C99 library designed specifically for embedded systems.
Loading...
Searching...
No Matches
memory_types.h File Reference
#include "juno/macros.h"
#include <stddef.h>
#include <stdint.h>
Include dependency graph for memory_types.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  JUNO_MEMORY_BLOCK_METADATA_TAG
 
struct  JUNO_MEMORY_ALLOC_HDR_TAG
 Structure for memory allocation header. Contains general information including the type of allocation. More...
 
struct  JUNO_MEMORY_TAG
 Structure for an allocated memory segment. Describes the allocated memory with a pointer to the start and its size. More...
 
struct  JUNO_MEMORY_BLOCK_TAG
 Structure representing a block-based memory allocator. Manages a fixed-size memory area along with associated free memory tracking. More...
 
union  JUNO_MEMORY_ALLOC_TAG
 Union for a generic memory allocation. Accommodates various allocation types, currently including block-based allocations. More...
 

Macros

#define JUNO_MEMORY_BLOCK(name, type, length)   static type name[length] = {};
 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] = {};
 Macro to declare a static array for memory metadata.
 
#define JUNO_REF(name)   REF##name
 
#define JUNO_NEW_REF(name)   JUNO_MEMORY_T *JUNO_REF(name)
 

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_HDR_TAG JUNO_MEMORY_ALLOC_HDR_T
 
typedef struct JUNO_MEMORY_TAG JUNO_MEMORY_T
 
typedef union JUNO_MEMORY_ALLOC_TAG JUNO_MEMORY_ALLOC_T
 
typedef enum JUNO_MEMORY_ALLOC_TYPE_TAG JUNO_MEMORY_ALLOC_TYPE_T
 Enumeration of memory allocation types.
 

Enumerations

enum  JUNO_MEMORY_ALLOC_TYPE_TAG { JUNO_MEMORY_ALLOC_TYPE_RESERVED = 0 , JUNO_MEMORY_ALLOC_TYPE_BLOCK = 1 }
 Enumeration of memory allocation types. More...
 

Macro Definition Documentation

◆ JUNO_MEMORY_BLOCK

#define JUNO_MEMORY_BLOCK (   name,
  type,
  length 
)    static type name[length] = {};

Macro to declare a static memory block and its associated free stack.

Parameters
nameName of the memory block.
typeData type of each block element.
lengthNumber of elements in the memory block.

◆ JUNO_MEMORY_BLOCK_METADATA

#define JUNO_MEMORY_BLOCK_METADATA (   name,
  length 
)    static JUNO_MEMORY_BLOCK_METADATA_T name[length] = {};

Macro to declare a static array for memory metadata.

Parameters
nameName of the metadata array.
lengthNumber of metadata entries.

◆ JUNO_NEW_REF

#define JUNO_NEW_REF (   name)    JUNO_MEMORY_T *JUNO_REF(name)

◆ JUNO_REF

#define JUNO_REF (   name)    REF##name

Typedef Documentation

◆ JUNO_MEMORY_ALLOC_HDR_T

◆ JUNO_MEMORY_ALLOC_T

◆ JUNO_MEMORY_ALLOC_TYPE_T

Enumeration of memory allocation types.

◆ JUNO_MEMORY_BLOCK_METADATA_T

◆ JUNO_MEMORY_BLOCK_T

◆ JUNO_MEMORY_T

Enumeration Type Documentation

◆ JUNO_MEMORY_ALLOC_TYPE_TAG

Enumeration of memory allocation types.

Enumerator
JUNO_MEMORY_ALLOC_TYPE_RESERVED 

Reserved allocation type.

JUNO_MEMORY_ALLOC_TYPE_BLOCK 

Block-based memory allocation.