Class Central is learner-supported. When you buy through links on our site, we may earn an affiliate commission.

YouTube

Taming Dynamic Memory - An Introduction to Custom Allocators in C++

code::dive conference via YouTube

Overview

Explore dynamic memory allocation in C++ and learn about custom allocators in this conference talk from code::dive 2018. Delve into basic allocation techniques like pooling and monotonic allocation, examining their performance and reliability. Understand technical challenges such as alignment and stateful allocator management in the standard library. Discover popular allocator implementations and how to integrate them with modern C++ codebases. Cover topics including coalescing, shared global state, memory leaks, runtime properties, and real-world examples. Examine STD vector, node-based containers, and hashmaps, discussing their extremes and rehash operations. Learn about padding, alignment, and natural alignment in memory allocation. Investigate the default allocator, single allocator, memory reclamation, and auxiliary data structures. Explore the pool allocator, its chunks, overwrite capabilities, and runtime costs. Understand multipool allocators, custom allocators in C, PMR memory resources, and global locators to enhance your C++ programming skills.

Syllabus

Introduction
The Simpsons
Agenda
What is dynamic memory
Coalescing
Shared Global State
Simpler locator
Memory leak
Runtime properties
Real world examples
STD vector
Nodebased containers
Hashmap
Hashmap extremes
Rehash operation
Why is it hard to guarantee
What happens on the DLL
Padding
Alignment
Natural alignment
Default allocator
Single allocator
Memory reclamation
Auxiliary data structure
Where to store auxiliary notes
Reasons to store auxiliary notes
The bottom line
The pool locator
Chunks
Overwrite
Put something back
Diffusion
Runtime cost
Memory consumption
Multipool
Custom allocators in C
Historical quirk
PMR memory resources
Chaining
Fixed vs Dynamic
Parameters
Global Locator
Wrapup

Taught by

code::dive conference

Reviews

Start your review of Taming Dynamic Memory - An Introduction to Custom Allocators in C++

Never Stop Learning.

Get personalized course recommendations, track subjects and courses with reminders, and more.

Someone learning on their laptop while sitting on the floor.