2 ms·
C/C++ are often used for things like drivers and operating systems. That code can't have elaborate runtime baggage. So if the memory safety were part of the st
by JoeAltmaier 14y ago
C/C++ are often used for things like drivers and operating systems. That code can't have elaborate runtime baggage.
So if the memory safety were part of the std lib heap for instance, go for it!
But if it means making one instruction (store into array) into 50 (checkthebounds, the store if safe else throw an exception) then it needs to be optional.
- dchichkov 14y agoYes. Good thing about C/C++ (particularly code with statically allocated memory and zero or few virtual calls) is that the resulting code behavior is very predictable. You can almost always expect it to be memory bound, and by counting your memory accesses and cache misses guesstimate the performance really well. I guess, that adding memory safety layer may destroy that predictability. If it does, than no - it needs to be optional.