Lecture 16. Allocators part II: Memory Resources and PMR (MIPT, 2025-2026).
Автор: Konstantin Vladimirov
Загружено: 2026-03-07
Просмотров: 557
Описание:
Master's degree lectures at MIPT on modern C++ in English. Department of Microprocessor Technologies.
This lecture continues our discussion of allocators in C++. We begin with the idea of memory_resource and soon discover that runtime polymorphism turns out to be a surprisingly convenient tool for implementing it. We then examine the standard resources provided by the library -- such as monotonic and multipool resources -- and see how they are used through polymorphic_allocator and the family of PMR containers. Next, we implement a simple test memory resource to observe how allocations flow through PMR and what the standard default resource actually is. After that, using Pablo Halpern's well-known example of a singly linked list, we analyze how allocators interact with container design, including the big-five operations and allocator propagation rules. Finally, we compare the development cost associated with different approaches to allocator abstraction.
00:00 Introduction: runtime polymorphism for memory_resource
06:15 Standard resources: monotonic and multipool
12:15 Polymorphic allocator and PMR containers
19:16 Test memory_resource: PMR and the default resource
25:52 Halpern example: slist and its design details
31:40 Allocators and the Big Five for slist
40:22 Exception safety strikes back
46:00 Preserving noexcept in the move constructor
53:06 Why are we not afraid of virtual calls?
56:53 Halpern's table, final thoughts, and bibliography
Lecturer: Konstantin Vladimirov.
Lecture date: February 11, 2026.
Filming assistance: Daniil Avdeev
Previous lecture: • Lecture 15. Allocators part I: Fine Tuning...
Next lecture: TBD
Slides for all lectures: https://sourceforge.net/projects/cpp-...
Code examples for all lectures: https://github.com/tilir/cpp-masters
Errata:
Empty for now.
Повторяем попытку...
Доступные форматы для скачивания:
Скачать видео
-
Информация по загрузке: