|
ra8-firmware 0.1.0
Bare-metal firmware for the Renesas RA8 family (RA8D2 / RA8P1)
|
The newlib heap syscall, replaced by a halting trap. More...
#include <stddef.h>Go to the source code of this file.
Functions | |
| void * | _sbrk (ptrdiff_t incr) |
| Trap that replaces newlib's heap-extension syscall. | |
The newlib heap syscall, replaced by a halting trap.
NASA Power of 10 Rule 3 forbids dynamic allocation after init, and target firmware has no heap at all. Firmware is freestanding and links with -nostdlib without newlib or libnosys. Standard allocator calls fail closed at link time. ra8_sbrk_trap.c provides a defense-in-depth tripwire so any legacy or external routine attempting to invoke _sbrk halts safely via ra8_fatal_error.
Definition in file ra8_sbrk_trap.h.
| void * _sbrk | ( | ptrdiff_t | incr | ) |
Trap that replaces newlib's heap-extension syscall.
Reports a fatal error and never returns. Reaching this means something called malloc, calloc, realloc, strdup or a C++ operator new on the target, which the firmware's zero-heap design forbids – so it halts at the call site rather than handing back storage that does not exist.
| [in] | incr | Bytes newlib wants the program break advanced by. Ignored: the trap never satisfies the request. |
| NULL | Unreachable; present only to satisfy the newlib contract. |
Definition at line 45 of file ra8_sbrk_trap.c.
References ra8_fatal_error().