Skip to content

Comment on Iterative Optimization on Hot Paths in Go Appsparent

Comments

But a stack allocation is 0 or 1 instructions.

Not if you have to check for stack space, like Go does.

It's no coincidence that a bump allocator and a function prologue have exactly the same structure: check against a limit and bump a thread-local pointer. There are runtimes like Chicken Scheme that actually implement heaps using the stack!

AboutSource Built by g1lg1l

Hackerly is an independent reader for Hacker News, built on the public HN API. Not affiliated with Y Combinator.