3 ms·
One advantage of managed memory is that it can be moved, which makes allocation extremely fast.
by chrisseaton 7y ago
One advantage of managed memory is that it can be moved, which makes allocation extremely fast.
- tachyonbeam 7y agoI'm playing the devil's advocate a bit. I come from a compiler background. If your language has strong memory guarantees, a good compiler might even be able to eliminate temporary allocations completely in some cases, which is pretty neat (ie: make you think you're heap allocating something, when in reality it's on the stack, or in registers).
- chrisseaton 7y agoBut that also requires managed memory. If your model is to call an opaque function `malloc` then the compiler can't reason about it to scalar replace it.