|
ra8-firmware 0.1.0
Bare-metal firmware for the Renesas RA8 family (RA8D2 / RA8P1)
|
newlib _sbrk() trap stub – enforces NASA Power of 10 Rule 3 More...
Go to the source code of this file.
Functions | |
| void * | _sbrk (ptrdiff_t incr) |
| Trap that replaces newlib's heap-extension syscall. | |
newlib _sbrk() trap stub – enforces NASA Power of 10 Rule 3
Target firmware is freestanding and links with -nostdlib without newlib or libnosys. General-purpose allocators (malloc, free, etc.) are unavailable and fail closed at link time with undefined symbol errors.
This file provides a strong _sbrk stub as defense-in-depth:
Project policy (NASA Power of 10 Rule 3: "No dynamic memory after initialisation") forbids any heap use in libs/ and src/.
Definition in file ra8_sbrk_trap.c.
| 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().