mirror of
https://github.com/libretro/RetroArch.git
synced 2026-11-07 08:36:02 -10:00
The tree's 3DS layer (the custom crt0 and link spec, system and memory setup, svchax, the old GPU command layer and the 3dsx/CIA launchers) lives under os/ctr, beside os/gekko and os/wiiu. The linear heap allocator is C: the same first-fit pool, so buffers land where they did, with live allocations found by address in an open-addressing table instead of a per-allocation tree node, and list nodes taken from cache-line-aligned slabs and reused. On the same trace it runs about half the instructions and practically no malloc/free calls. With the whole heap allocated, a further allocation now fails instead of starting the heap over and handing out its first address again, and the free-space queries no longer fault. samples/frontend/ctr_linear checks placement, alignment, coalescing, the full-heap case and pages handed back from the heap's end.