Skip to content

A World Without a Heap: Getting Memory Allocation Right First ​

Status: rolling out progressively

Overview ​

In a kernel with no heap, no exceptions, and no RTTI, where do the task control blocks and the messages live? That is the first real question the smoke test left behind. At this station we first think things through: what ways there are to hand out memory, why the fixed-size block pool is the pick, and what makes a bitmap a good bookkeeping scheme. Then we get hands-on, one article at a time — the bitmap, the pool, the typed facade — with each article bringing one new mechanism and one test gate, and the defenses written into compile time as negative compilation tests. Finally we haul the pool onto a -nostdlib target and run into three gates in a row. The closing article leaves behind a cliffhanger — "even adding constinit won't compile" — which the opening of the next topic settles with a pair of square brackets.

Articles at This Station ​

The next article hits the -nostdlib wall: memset goes missing, nobody picks up the bill for global constructors, and __cxa_guard_* has nowhere to call home — three gates, taken one at a time. Rolling out progressively.

pdf-latest-4-g85128cc · 85128cc · 2026-10-05