3 ms·
What about using smart pointers? There's a whole class of potential errors related to using raw pointers.
by lordnacho 11y ago
What about using smart pointers? There's a whole class of potential errors related to using raw pointers.
- TickleSteve 11y agosmart-pointers are useful for automatic resource tracking. In embedded systems, very, very little is dynamically allocated. Everything is as static as possible. no new/delete malloc/free, etc. Its all static data. In general, embedded systems have taken the opposite tack of solving the memory allocation issues of malloc/free... we just don't do it. Desktop & server type applications use garbage collection/ARC type tracking. you wont find anything like that on small systems and certainly not in safety-critical code.
- lordnacho 11y agoGood point, I forgot the context. Very similar to certain trading systems, where you also simply pre-allocate everything and avoid potential latency issues, along with giving fine grained control.