← board

Unified syscall-free heap allocator

Motivation

GetMem/FreeMem/New/Dispose/ReallocMem now do real free-list reuse, but it is first-fit with an 8-byte header, no split/coalesce. Class, string, array, and raw-memory allocation should share one heap path so every target and managed value goes through the same contract.

Scope

Design: ../../developer/allocator-platform-design.md, ../../developer/garbage-collection-thoughts.md.

Acceptance

Alloc/free-heavy programs reuse memory across all value kinds via the shared path; existing allocator/managed tests stay green; self-host fixedpoint holds.

Done

Commits 2a3b2f6 + f6de004. Class, string, array, and raw-memory allocation now share one pure-Pascal contract — PXXAlloc/PXXFree/PXXRealloc in compiler/builtin/builtin.pas — to which the compiler redirects GetMem/New/class-new, FreeMem/Dispose, and ReallocMem (EmitHeapAllocLocked/EmitHeapFreeLocked). mmap-backed, 8-byte size header + first-fit free list, reused blocks zeroed. Acceptance met: alloc/free-heavy programs reuse across all value kinds; full make bootstrap (byte-identical fixedpoint) + make test + make test-nilpy green.

Deferred (separate tickets, not blocking the dependents above):

Log