|
oveRTOS C API
Embedded RTOS framework — build system, configuration, and portable C API
|
Compile-time guard against libc heap allocators in zero-heap mode. More...
#include "ove_config.h"

Go to the source code of this file.
Compile-time guard against libc heap allocators in zero-heap mode.
When CONFIG_OVE_ZERO_HEAP=y, calls to libc malloc / calloc / realloc / zalloc / memalign from oveRTOS application code fail at compile time with a __attribute__((error)) diagnostic. This is a hard layer beneath the runtime trap in backends/common/ove_heap_lock.c — most violations are caught before the binary is even linked.
Pulled in via ove/ove.h, so any TU that includes the umbrella header is covered. Backend infra that legitimately needs the libc allocator path (e.g. the wrap trampolines in backends/common/ove_heap_lock.c calling __real_malloc, or the NuttX backend's mm_malloc(USR_HEAP, ...) direct calls) bypasses this header by not including ove/ove.h from the path that touches those symbols, or by referencing the renamed/internal symbols directly.
free() is intentionally not poisoned: destruction is allowed post-lock (see the rationale in ove_heap_lock.c:__wrap_free), and free(NULL) is a common cleanup idiom.