logoalt Hacker News

wmwraggyesterday at 11:34 PM2 repliesview on HN

My understanding of zero alloc is that there are no heap allocations i.e. use of a form of malloc. At least that has always been my experience, use of the stack is perfectly fine


Replies

dezgegyesterday at 11:49 PM

Some stricter interpretations also require that maximum stack usage can be statically analyzed (ie. no recursion, no function pointers, no VLAs/alloca).

show 1 reply
Neywinytoday at 12:48 AM

But it puts sizeable arrays on the stack. That's not really better since instead of an out of memory exception it'll just corrupt the stack of on the majority of embedded implementations that don't have hardware stack protection in use or available.

show 4 replies