4 ms·
> and putting it on the stack turns out to be cheaper than heap allocating it. Well, more so that C has no concept of the heap. That's entirely contained withi
by ori_b 15y ago
> and putting it on the stack turns out to be cheaper than heap allocating it.
Well, more so that C has no concept of the heap. That's entirely contained within the C libraries. So, the language implementation itself can't do heap allocations (at least, not without sacrificing any chance of using it in embedded or kernel dev situations where you don't have heap allocation, or where you need to use custom allocators)
- swdunlop 15y agoIf you're using closures in an embedded environment with no heap, you've got bigger problems than executable stacks to worry about..