28#if defined(__has_include)
29#if __has_include("mmgr_settings.h")
30#include "mmgr_settings.h"
34#include "embed_compiler_directives.h"
35#include "embed_dispatch_layout.h"
36#include "embed_types.h"
67#ifndef MMGR_ALIGN_BYTES
69#define MMGR_ALIGN_BYTES 16u
71#if (MMGR_ALIGN_BYTES < 1) || ((MMGR_ALIGN_BYTES & (MMGR_ALIGN_BYTES - 1)) != 0)
72#error "MMGR_ALIGN_BYTES must be a power of two - an alignment specifier takes nothing else"
85#ifndef MMGR_EXTRAM_ATTR
86#define MMGR_EXTRAM_ATTR
101#if EMBED_HAS_ATTRIBUTE(error)
102#define MMGR_ERROR_ATTR(msg_) __attribute__((error(msg_)))
104#define MMGR_ERROR_ATTR(msg_)
122#if EMBED_HAS_ATTRIBUTE(alloc_size)
123#define MMGR_ALLOC_SIZE(arg_) __attribute__((alloc_size(arg_)))
125#define MMGR_ALLOC_SIZE(arg_)
140#define MMGR_PARS_TOKEN(name_) int mmgr_pars_token_##name_ = 0
157#define MMGR_PARS_DECLARED_ONCE(name_) \
160 name_##_declared_twice_but_a_pool_symbol_names_one_region_only = 0 \
177#define MMGR_PARS_CLAIMED_ONCE(name_) \
180 name_##_claimed_twice_but_a_pool_is_dressed_once = 0 \
199#define ParsMemoriaeInternae(name_, bytes_) \
200 MMGR_PARS_DECLARED_ONCE(name_); \
201 MMGR_PARS_TOKEN(name_); \
204 name_##_bytes = (bytes_) \
206 EMBED_ALIGN(MMGR_ALIGN_BYTES) static EMBED_PASS_MEMORY uint8_t mmgr_pars_storage_##name_[bytes_]; \
207 static EMBED_PASS_MEMORY const uint8_t *const name_ EMBED_UNUSED = mmgr_pars_storage_##name_; \
208 EMBED_STATIC_ASSERT(sizeof(mmgr_pars_storage_##name_) == name_##_bytes, #name_ " is not the size it was declared")
224#define ParsMemoriaeHospes(name_) \
225 MMGR_PARS_DECLARED_ONCE(name_); \
226 MMGR_PARS_TOKEN(name_)
239#if MMGR_ENABLE_EXTRAM
240#define ParsMemoriaeExternum(name_, bytes_) \
241 MMGR_PARS_DECLARED_ONCE(name_); \
242 MMGR_PARS_TOKEN(name_); \
245 name_##_bytes = (bytes_) \
247 EMBED_ALIGN(MMGR_ALIGN_BYTES) static EMBED_PASS_MEMORY uint8_t mmgr_pars_storage_##name_[bytes_] MMGR_EXTRAM_ATTR; \
248 static EMBED_PASS_MEMORY const uint8_t *const name_ EMBED_UNUSED = mmgr_pars_storage_##name_; \
249 EMBED_STATIC_ASSERT(sizeof(mmgr_pars_storage_##name_) == name_##_bytes, #name_ " is not the size it was declared")
267#define MMGR_ASSERT(cond_, msg_) ((void)sizeof((cond_) ? 1 : 0), (void)0)
298#if EMBED_HAS_ATTRIBUTE(noreturn)
299#define MMGR_NORETURN_ATTR __attribute__((noreturn))
301#define MMGR_NORETURN_ATTR
319#define MMGR_FATAL(msg_) ((void)(msg_), mmgr_fatal_halt())
Placement between internal and external memory, and a two-buffer index.
DMA channels: the completion event, the port hooks, the praet dispatch table, and the schedule and de...
static EMBED_HOST_DEVICE MMGR_NORETURN_ATTR void mmgr_fatal_halt(void)
The halt of the default MMGR_FATAL: a spin that does not return.
#define MMGR_NORETURN_ATTR
Stops the program on an illegal call, in every build.