Memory Management
8 pages — smart pointers, allocators, RAII, placement new, and PMR.
C++ custom allocators and C++17 polymorphic memory resources: arena, pool, PMR containers, allocator propagation, and zero-heap hot paths.
C++ memory management — RAII, smart pointers, arenas, PMR allocators, object pools, placement new, and avoiding heap pitfalls.
Construct objects in pre-allocated memory using placement new, std::construct_at, std::destroy_at, and std::launder for allocators, pools, and variant storage.
unique_ptr, shared_ptr, and weak_ptr — ownership semantics, control block internals, custom deleters, cycle breaking, and enable_shared_from_this.
A reference-counted smart pointer that enables shared ownership of a dynamically allocated object, deleting it when the last owner is destroyed.
Exclusive-ownership smart pointer that automatically frees its managed object when it goes out of scope, with zero overhead over a raw pointer.
A non-owning smart pointer that observes a shared_ptr-managed object without extending its lifetime, enabling cycle-breaking and safe expiry detection.
C++ weak_ptr usage patterns — breaking cycles, observers, caches, enable_shared_from_this, and thread-safe access via lock().