HackerTube.dev

CppCon 2015: Andrei Alexandrescu “std::allocator...”

CppCon · 196.5K views · 2015-10-13 · 1:12:27

Open on YouTube ↗

If playback is restricted in your region, try opening the original video. Use Mark watched to add it to your marked videos.

Overview

Andrei Alexandrescu's CppCon 2015 talk argues that std::allocator is badly designed. He proposes building high-performance allocators from small composable, templated pieces.

On Hacker News

HN repeatedly recommends it as an entertaining, mind-opening talk on allocator design and composable generic programming.

Recommended by 7 HN people across 11 months · HN mentions 2017–2025

Topics

Search by tags

What people said

jiggawatts · 2025-01 · Strong recommendation

> The issue with this approach is that the more you can control, the less the compiler can assume. That's absolutely true, but there's a workaround, albeit a complicated one. The compiler internals need the same kind of constraints or traits that abstract code such as language interfaces or template parameters can have. These can then be used to constrain the internals in a way that then would allow assumptions to be safely "plumbed through" the various layers. The (big!) challenge here is that these abstractions haven't been well-developed in the industry. Certainly nowhere near as well as the typical runtime "type theory" as seen in modern languages. > some very basic ones like allocating heap memory. Well... this is sort-of my point! For example, what's the fundamental difference between allocating memory in some heap[1] structure at runtime and a compiler allocating members in a struct/record/class for optimal packing? IMHO, not much. E.g.: Watch this talk by Andrei Alexandrescu titled "std::allocator Is to Allocation what std::vector Is to Vexation": [VIDEO] It really opened my eyes to how one could very elegantly make a very complex and high-performance heap allocator from trivial parts composed at compile-time. There's no reason that a nearly identical abstraction couldn't also be used to efficiently "bin pack" variables into a struct. E.g.: accounting for alignment, collecting like-sized items into contiguous sections, extra padding for "lock" objects to prevent cache

Read the original HN comment ↗
jiggawatts · 2023-01 · Strong recommendation

Not exactly a lecture series, but Andrei Alexandrescu has had some fantastic keynote presentations at CppCon. I don't even program in C++ any more, but I've watched these more than once, they're entertaining, approachable, and inspiring: Speed Is Found In The Minds of People [LINK] std::allocator Is to Allocation what std::vector Is to Vexation [VIDEO] An actual lecture series I've enjoyed watching is "The WE-Heraeus International Winter School on Gravity and Light", which covers General Relativity using modern mathematical approaches: [LINK] Again, I haven't done physics in 20 years, but I've found it surprisingly easy to follow because it is so clearly presented.

Read the original HN comment ↗
jiggawatts · 2020-12 · Strong recommendation

Every time I hear someone talking about writing a memory allocator, it always reminds me of the brilliant CppCon 2015 talk by Andrei Alexandrescu about how he wrote an modular allocator library that can be built up in pieces to make whatever you like. [VIDEO]

Read the original HN comment ↗

Sources

Video by CppCon, played through YouTube.

Data and selection notes

HN summaries and labels may contain AI errors. HN dates refer to discussions, not video publication.

HN Library: HackerTube export (2026-10-31) and open-index/hacker-news. Upstream summaries and classifications may contain AI errors.

Views, duration and playback status refresh separately from the published catalog. When an update fails, existing data remains visible.

Selection checks
  • SaaS & AI candidates: Topic keywords do not match
  • Editor-approved picks: Editorial review is required

Rule matches identify candidates. They do not guarantee video quality or financial results.

About the library and its sources