← board

Allocator quality: split / coalesce / bins / alignment

Motivation

The shared pure-Pascal allocator (PXXAlloc/PXXFree/PXXRealloc, compiler/builtin/builtin.pas) is delivered and self-hosts, but is deliberately simple: first-fit free list, 8-byte size header, no splitting/coalescing, reused blocks returned whole (over-allocate when a big freed block serves a small request), and Realloc always copies on grow.

Scope

Do this only after measuring real fragmentation/throughput on the compiler's own allocation pattern; the simple version is correct and may be good enough.

Acceptance

Fragmentation/throughput improves on a measured workload with no correctness regression; make bootstrap byte-identical + make test + make test-nilpy stay green.

Log