←back to thread

327 points AareyBaba | 2 comments | | HN request time: 0s | source
Show context
mwkaufma ◴[] No.46183728[source]
TL;DR

- no exceptions

- no recursion

- no malloc()/free() in the inner-loop

replies(9): >>46183820 #>>46183900 #>>46184073 #>>46184113 #>>46184198 #>>46184398 #>>46184472 #>>46184588 #>>46185500 #
jandrewrogers ◴[] No.46183820[source]
i.e. standard practice for every C++ code base I've ever worked on
replies(1): >>46183866 #
DashAnimal ◴[] No.46183866[source]
What industry do you work in? Modern RAII practices are pretty prevalent
replies(2): >>46183904 #>>46184092 #
jandrewrogers ◴[] No.46183904[source]
What does RAII have to do with any of the above?
replies(4): >>46183995 #>>46184069 #>>46184097 #>>46184150 #
1. DashAnimal ◴[] No.46184097{3}[source]
Well if you're using the standard library then you're not really paying attention to allocations and deallocations for one. For instance, the use of std::string. So I guess I'm wondering if you work in an industry that avoids std?
replies(1): >>46184756 #
2. jandrewrogers ◴[] No.46184756[source]
I work in high-scale data infrastructure. It is common practice to do no memory allocation after bootstrap. Much of the standard library is still available despite this, though there are other reasons to not use the standard containers. For example, it is common to need containers that can be paged to storage across process boundaries.

C++ is designed to make this pretty easy.