An Allocator Is a Handle to a Heap
Explore the concept of allocators as handles to heaps in C++ through this comprehensive conference talk from C++Now 2018. Delve into the std::pmr framework introduced in C++17, understanding how std::pmr::polymorphic_allocator works with std::pmr::memory_resource. Discover the true meaning of the Allocator concept, tracing its evolution since C++98. Learn about the implications of viewing allocators as lightweight, efficiently copyable handles, including the impossibility of implementing an "in-place" std::vector using allocator tricks. Examine non-standard examples of Allocator types, such as shmem_allocator and shutdown_safe_allocator. Explore topics like the behavior of moved-from allocator objects, relationships between allocators and concepts like façades and adaptors, and potential similarities between allocator/heap and executor/execution-context pairs. Gain insights into designing efficient and effective memory management systems in C++.