CppCon 2015: Andrei Alexandrescu “std::allocator...”
CppConYouTube ↗
Further reading 1
Caption notes
At CppCon 2015, Andrei Alexandrescu proposes building memory allocators from small parts that can be combined to handle requests with different strategies. He passes a pointer and length together as a memory block and uses a fallback allocator to explain why the interface also has to account for deallocation. If the first allocator cannot satisfy a request, a second can try. When the block is freed, it has to go back to the allocator that supplied it. In his example, the primary allocator can tell whether it owns a given block.
Archived captions (transcription method unspecified) ↗Original passages · 2
it has the pointer and the lengthif you want to write an allocator you got to make it composable