5 ms·
Having worked on a few decently large C++ codebases, I can confidently say that this is not how I view things. Shared pointers might be pretty drastically overu
by ladberg 4y ago
Having worked on a few decently large C++ codebases, I can confidently say that this is not how I view things. Shared pointers might be pretty drastically overused by some programmers but have use cases, and I think unique pointers are pretty invaluable.
I can't imagine writing a long running, memory conscious, and fast C++ program that uses whatever 'macro' management strategy you envision.
- deleted 4y ago[deleted]
- anonymoushn 4y agoThis is pretty simple actually! At startup, create some object pools, arenas, or bump allocators. Then, never heap allocate anything ever. We also happen to do 0 other steady-state syscalls (not just 0 mmap, munmap, mremap, etc.), so we can just run the program under valgrind and any time valgrind prints something is a bug. We didn't use C++ but some other software I've heard uses a similar approach is written in C++.