>> Even when you’re merely at the edge of this trap, your defect rates will be dominated by issues like double-free errors and malloc leaks. This is commonly the case in C/C++ programs of even low greenspunity.
Citation needed. In my dayjob developing a major game engine in C++, we spend zero time on double-free errors or malloc leaks.
Generalized ESR presumption based on no data and outdated methods.
Albeit I generally agree that smart but manual memory management works better and is more predictable. (range/scope based like in C++ RAII or Rust)
If needed for performance, with memory pools.
There are different kings of automated too. Simple refcounting is sufficient for almost all cases but has to be still manually applied instead of guesswork to prevent performance bugs and leaks.
A specialized memory pool can be written in C++11 in less than 100 lines. (Likewise a thread pool.) Template even.
A smart pointer with or without refcounting is in standard. Compared to the immensity of GC these are easy to use and tune.
4 comments
[ 3.6 ms ] story [ 17.6 ms ] threadCitation needed. In my dayjob developing a major game engine in C++, we spend zero time on double-free errors or malloc leaks.
Albeit I generally agree that smart but manual memory management works better and is more predictable. (range/scope based like in C++ RAII or Rust) If needed for performance, with memory pools.
There are different kings of automated too. Simple refcounting is sufficient for almost all cases but has to be still manually applied instead of guesswork to prevent performance bugs and leaks.
A specialized memory pool can be written in C++11 in less than 100 lines. (Likewise a thread pool.) Template even.
A smart pointer with or without refcounting is in standard. Compared to the immensity of GC these are easy to use and tune.