CppCon 2017: Bob Steagall “How to Write a Custom Allocator”

  Рет қаралды 57,307

CppCon

CppCon

6 жыл бұрын

CppCon.org
-
Presentation Slides, PDFs, Source Code and other presenter materials are available at: github.com/CppCon/CppCon2017
-
You'd like to improve the performance of your application with regard to memory management, and you believe this can be accomplished by writing a custom allocator. But where do you start? Modern C++ brings many improvements to the standard allocator model, but with those improvements come several issues that must be addressed when designing a new allocator.
This talk will provide guidance on how to write custom allocators for the C++14/C++17 standard containers. It will cover the requirements specified by the standard, and will describe the facilities provided by the standard to support the new allocator model and allocator-aware containers. We'll look at the issues of allocator identity and propagation, and examine their implications for standard library users, standard library implementers, and custom allocator implementers. We'll see how a container uses its allocator, including when and how a container's allocator instance propagates. This will give us the necessary background to describe allocators that implement unusual semantics, such as a stateful allocator type whose instances compare non-equal. Finally, the talk will provide some guidelines for how to specify a custom allocator's public interface based on the semantics it provides.
-
Bob Steagall: KEWB Computing, CppCon 2017 Poster Chair
I've been working in C++ for the last 25 years. The majority of my career has been spent in medical imaging, where I led teams building applications for functional MRI and CT-based cardiac visualization. After a brief journey through the world of DNS and analytics, I'm now working in the area of stream processing.
-
Videos Filmed & Edited by Bash Films: www.BashFilms.com
*-----*
Register Now For CppCon 2022: cppcon.org/registration/
*-----*

Пікірлер: 22
@kinershah464
@kinershah464 Жыл бұрын
Very good presentation. He must have done a lot of research and studying to compile the content for this presentation.
@sicko815
@sicko815 6 ай бұрын
Watching this after John Lakos' talk Such a beautiful follow up
@s_alexander_n
@s_alexander_n 3 ай бұрын
Thank you, Bob Steagall! 😃
@seidenada526
@seidenada526 6 жыл бұрын
Don't watch this talk if you are looking for some code examples. The subject is more like "What traits and types you should study in order to be able to write a custom allocator". Good material though.
@cypix314123
@cypix314123 6 жыл бұрын
Yeah, it is more about what you need to define (in terms of traits) and how those definitions fit together. It is also a bit of history which could prove useful if you need to modernize allocators written by someone else.
@Kalumbatsch
@Kalumbatsch 6 жыл бұрын
Right, in that case you should watch the talk "Custom allocator code to cut & paste", this one is more about how to write a custom allocator.
@seidenada526
@seidenada526 6 жыл бұрын
I prefer the talk of Andrei Alexandrescu in the CppCon 2015 about std :: allocator. Way more fun and teachful than your sarcasm.
@Kalumbatsch
@Kalumbatsch 6 жыл бұрын
Maybe, if "teachful" was a word.
@jflopezfernandez
@jflopezfernandez 6 жыл бұрын
Awesome talk, thank you
@JohnForTheWin
@JohnForTheWin 2 жыл бұрын
Great talk!
@tohopes
@tohopes 6 жыл бұрын
20:10 deep propagation of alligators pretty scary!
@pskocik
@pskocik 4 жыл бұрын
it's what the reptilians want. they've deeply infiltrated c++ now.
@IK-ow2zk
@IK-ow2zk 3 жыл бұрын
Thanks a lot for the video!
@CppCon
@CppCon 3 жыл бұрын
Glad it was helpful!
@lorenzobolis5166
@lorenzobolis5166 5 жыл бұрын
Anyone care to explain what the example at 11:00 is, or how it can be used? Because I have no clue whatsoever
@user-jl7yi7dh9e
@user-jl7yi7dh9e 6 жыл бұрын
Thank you! Спаси Господи!
@sproccoli
@sproccoli 6 ай бұрын
i do not support alligator propagation. We have enough of them already.
@anon_y_mousse
@anon_y_mousse 2 жыл бұрын
Very informative, but Bob needs to incorporate some levity and differ the pitch of his voice from time to time. I nearly fell asleep.
@pajeetsingh
@pajeetsingh 5 жыл бұрын
Why can't we just use new and delete again?
@Theodorlei1
@Theodorlei1 4 жыл бұрын
The default stays new and delete :) Allocators allow you to open the hood and choose a different option if you need to
@movax20h
@movax20h 4 жыл бұрын
@Drip all of these can be solved with global allocator. Custom allocators are very niche and somehow over rated. Mostly useful to using stack as primary allocation with fallback, and for arena allocation. But even for that you don't need standard tools and can roll your own stuff for it, but if you try to use stl containers then you need to use them , or write an adapter.
@debashishdeka7698
@debashishdeka7698 Жыл бұрын
@@movax20h they are still useful when you want to isolate the alloac and dealloc calls from the global allocator for some reason. (may be initial dev ). Also, for some library like json in c++, a developer might want to use some different allocator to improve performance.
Amazing weight loss transformation !! 😱😱
00:24
Tibo InShape
Рет қаралды 66 МЛН
No empty
00:35
Mamasoboliha
Рет қаралды 10 МЛН
Magnus Carlsen vs Daniil Dubov || FIDE World Rapid Team Chess Championship (2024)
14:55
How to write SOLID C++
29:22
platis.solutions
Рет қаралды 40 М.