“This book contains something for everyone, even the most seasoned C++ programmer.”- Guy Davidson, ISO C and C++ Standard Committee Voting Member
“A solid foundation in memory management that quickly builds to advanced, modern C++ concepts.”- Yacob Cohen Arazi, Software Engineer at NVIDIA
“This book challenged my thinking and changed how I design embedded C++ systems.”- Khalil Estell, ISO C++ Committee Member
Key FeaturesUse contemporary C++ features to enhance code safety and reliabilityDevelop a deeper understanding of memory management mechanisms in C++Write programs that adapt to the constraints of your chosen architecture or platformBook DescriptionMemory management in C++ isn't one-size-fits-all; real-time systems, games, and embedded applications each present unique memory constraints. This book delivers targeted solutions for each domain.
Written by ISO C++ Standards Committee member, Patrice Roy, this guide covers fundamental concepts of object lifetime and memory organization to help you write simpler and safer programs. You’ll learn how to control memory allocation mechanisms, create custom containers and allocators, and adapt allocation operators to suit your specific requirements, making your programs smaller, faster, safer, and more predictable.
From core principles to modern facilities that simplify your work, you’ll master memory management mechanics, build tailored memory solutions for your application needs, and measure their impact on your program’s behavior.
By the end of this book, you’ll be able to write secure programs that handle memory optimally for your application domain. You will also have a strong grasp of both high-level abstractions for safer programs and low-level abstractions that allow detailed customization.
What you will learnMaster the C++ object model to write more efficient and maintainable codeAutomate resource management to reduce manual errors and improve safetyCustomize memory allocation operators to optimize performance for specific applicationsDevelop your own smart pointers to manage dynamic memory with greater controlAdapt allocation behavior to meet the unique needs of different data typesCreate safe and fast containers to ensure optimal data handling in your programsUtilize standard allocators to streamline memory management in your containersWho this book is forThis book is for programmers who find C++ memory management challenging yet want to master it. It’s ideal for those seeking greater control over memory allocation to make their programs smaller, faster, and safer. Whether you're a seasoned C++ developer or transitioning from other languages, you'll gain insights into how C++ can enhance your programming. It’s especially valuable if you’re working in constrained environments, like embedded systems or game development. Prior experience with programming concepts, such as generic and concurrent programming, is helpful.
Table of ContentsObjects, Pointers, and ReferencesThings to Be Careful WithCasts and cv-qualificationsUsing DestructorsUsing Standard Smart PointersWriting Smart PointersOverloading Memory Allocation Operators&
This is a very niche book, but for those who work on systems that absolutely need speed and stability, this is a must-read. While the one critique I have of this book is the lack of focus, it is still a very good read. There are a few books that touch on memory management in this level of detail. The lack of focus really is in the early chapters of the book as the author felt the need to go into a lot of details on general C++ knowledge that almost felt like it was something out of Scott Meyer's books. While great information, it was a little redundant. I already knew so of this, so a hint to skip ahead would have been appreciated. The coverage on the topic was great; it would have just been a shorter book (about 1/2 the size it currently is). I suspect that it was needed if you have never worked at this level with C++, so it is only a minor issue. There is a bit of an academic vibe throughout this book, as there were not a lot of real-world examples. Anyone who has ever worked on a game engine will recognize the need for Memory Management and the difference it can make (especially with console games). It would have been nice to have more of those perspectives. I gave it one less star from the point of view that it should have really tied memory management to why you need memory management.