3 ms·
No, but not because of performance. Malloc/free is required for deterministic runtime behavior. A GC would take that away. Would Linus accept a language that i
by darksaints 4y ago
No, but not because of performance. Malloc/free is required for deterministic runtime behavior. A GC would take that away.
Would Linus accept a language that is more than 1% slower than optimal? Yes, he already does. It's called C. C is slower than optimal assembly.
He chose C because it is easier to write large systems in a higher level language, and it is far easier to write cross platform code in.
- pjmlp 4y agoThat is a common mistake, malloc()/free() aren't deterministic, specially in threaded code, heaviliy loaded system, ISO C doesn't even provide guarantees of how deterministic they should come back to the caller across C implementations.
- cozzyd 4y agoSure but you control when you call them.
- WalterBright 4y agoIn D you also control when to call the GC.
- pjmlp 4y agoIf you call them explicitly, you control the call. There is no control over the duration, or what third party code is doing with them.