Carmack: Give every stack a full virtual address space on 64-bit and let it do memory management

ID_AA_Carmack · x · 2026-10-24

John Carmack argues alloca() has been unfairly frowned upon, and that 64-bit architectures should give every stack a virtual address space equal to physical memory by default. Stack allocation is a trivial pointer bump and frees are literally free; linearly packed memory is friendlier to the whole cache hierarchy and makes huge/gigantic pages easy. Static analysis can catch storing a stack pointer into deeper structures (use-after-free), guaranteeing correctness. He admits caller-allocates-return is awkward in dynamic cases and would need calling-convention changes. He closes by musing whether AI coding agents make software architecture discussions more or less important.

Original post →

More from coding & agent

coding & agent channel →