Did you like how we did? Rate your experience!

4.5

satisfied

46 votes

What are some good books for understanding memory management in C?

I am glad to read the several answers you have specific to C and low level optimization. Ever since 2011, C++ has taken a leading position due to some key improvements with regards to templates, constant expressions, and runtime efficiency using rvalue and move semantics. While it is fine to use C for many situations, the world is moving towards C++. It has since become possible to write code in C++ that executes as fast or faster than the equivalent C code and the C++ is cleaner, more convenient, and more powerful in many cases. C++ since 2011 supports smart pointers such as scoped_ptr and shared_ptr. These allow you to ignore manual deallocation of memory in the great majority of cases by following a principle called RAII: Resource Allocation Is Initialization. RAII and smart pointers in C++ Another nice benefit of C++ is that it has better support for custom allocators than C. C++: Custom memory allocation - General Programming - Articles - Articles By using these modern features it is possible to have the best of both worlds: simpler and safer source code for the programmer and faster execution at runtime when compared to C.

100%
Loading, please wait...