34#ifndef OVE_HEAP_ASSERT_H
35#define OVE_HEAP_ASSERT_H
37#include "ove_config.h"
57#if defined(CONFIG_OVE_ZERO_HEAP) && !defined(__BINDGEN__) && !defined(__ZIG_CIMPORT__) && \
58 !defined(__EMSCRIPTEN__) && !defined(__OVE_LINT__)
62#define _OVE_HEAP_FORBIDDEN(name) \
63 __attribute__((error("oveRTOS zero-heap mode forbids libc " name "(); use " \
64 "OVE_*_DEFINE_STATIC / ove_*_init() with caller-supplied " \
65 "storage, or build with CONFIG_OVE_ZERO_HEAP=n if dynamic " \
66 "allocation is required.")))
72#define _OVE_HEAP_NOTHROW noexcept
74#define _OVE_HEAP_NOTHROW
87extern void *malloc(
size_t) _OVE_HEAP_NOTHROW _OVE_HEAP_FORBIDDEN(
"malloc");
88extern void *calloc(
size_t,
size_t) _OVE_HEAP_NOTHROW _OVE_HEAP_FORBIDDEN(
"calloc");
89extern void *realloc(
void *,
size_t) _OVE_HEAP_NOTHROW _OVE_HEAP_FORBIDDEN(
"realloc");
90extern void *zalloc(
size_t) _OVE_HEAP_NOTHROW _OVE_HEAP_FORBIDDEN(
"zalloc");
91extern void *memalign(
size_t,
size_t) _OVE_HEAP_NOTHROW _OVE_HEAP_FORBIDDEN(
"memalign");
92extern void *aligned_alloc(
size_t,
size_t) _OVE_HEAP_NOTHROW _OVE_HEAP_FORBIDDEN(
"aligned_alloc");
98#undef _OVE_HEAP_NOTHROW
99#undef _OVE_HEAP_FORBIDDEN