5 ms·
The compiler can't really reason very well about the data layout - it can reason about the instructions
by VHRanger 5y ago
The compiler can't really reason very well about the data layout - it can reason about the instructions
- jimmyed 5y agoIt can also reason about control flow. It does constant folding etc, is it at least theoretically possible to do alloc optimization?
- chakkepolja 5y agoYep but that would probably break predictability. In low level code I wouldn't rely on some malloc being optimized away, and rather write code explicitly without allocations. In High level languages, Escape analysis exists.