Class layout, Miloš Anđelkovic

This is a talk about how the non static member variables are laid out in memory. Part that is not covered is the case with virtual inheritance as it complicates things and this should only take an hour. We start out with the Standard layout type, what it is, why it exists and what are it's requirements. Then the exploration of the language rules how the different blocks of variables with the same access can be moved around and how that was changed in C++23. Next the inheritance and how it impacts the layout of the class with the mention of empty base class optimization. As a pair to inheritance the same (similar example) using composition (member variables) and no_unique_address attribute. This followed with examples using the clangs -cc1 - fdump-record-layouts which will generate reports for the layouts of the classes. As part of this mention the Subobjects. Alignment requirements of the operating system and C++ and padding. Brief mention of alignof and alignas operators and many align_ functions in C++, but just a mention as there will be no time for details. Finally a simple benchmark showing difference in performance between the structs that have the same member variables but one has a «good» and the other «bad» layout.

Tips for C Programming
▶︎

Tips for C Programming

Python OOP Will Finally Make Sense After This
▶︎

Python OOP Will Finally Make Sense After This

Turing Award Winner: Disagreeing with Google, Postgres, Future Problems | Mike Stonebraker
▶︎

Turing Award Winner: Disagreeing with Google, Postgres, Future Problems | Mike Stonebraker

Richard P. Feynman: Probability and Uncertainty; The Quantum Mechanical View of Nature
▶︎

Richard P. Feynman: Probability and Uncertainty; The Quantum Mechanical View of Nature

Blue Ridge Ruby 2026 - LLM Telemetry as a First-Class Rails Concern by  David Paluy
▶︎

Blue Ridge Ruby 2026 - LLM Telemetry as a First-Class Rails Concern by David Paluy

Creator of C++: Bell Labs, Negative Overhead Abstraction, Mistakes | Bjarne Stroustrup
▶︎

Creator of C++: Bell Labs, Negative Overhead Abstraction, Mistakes | Bjarne Stroustrup

Ocean Waves for Deep Sleep LIVE 🌊 Rolling Waves & Dark Screen  Reduce Anxiety, Stress & Sleep Aid
▶︎

Ocean Waves for Deep Sleep LIVE 🌊 Rolling Waves & Dark Screen Reduce Anxiety, Stress & Sleep Aid

Andrew Kelley: A Practical Guide to Applying Data Oriented Design (DoD)
▶︎

Andrew Kelley: A Practical Guide to Applying Data Oriented Design (DoD)

Co-Creator of Haskell: Useless vs Useful Languages, Rust vs C, Functional Programming | Simon Jones
▶︎

Co-Creator of Haskell: Useless vs Useful Languages, Rust vs C, Functional Programming | Simon Jones

“Listen Like You Might Be Wrong” | Harvard Student’s Viral Speech Amid Trump-Harvard Feud
▶︎

“Listen Like You Might Be Wrong” | Harvard Student’s Viral Speech Amid Trump-Harvard Feud

"Clean" Code, Horrible Performance
▶︎

"Clean" Code, Horrible Performance

New Jellyfish Aquarium • Healing of Stress, Anxiety and Depressive States • Goodbye Insomnia #30
▶︎

New Jellyfish Aquarium • Healing of Stress, Anxiety and Depressive States • Goodbye Insomnia #30

CppCon 2014: Mike Acton "Data-Oriented Design and C++"
▶︎

CppCon 2014: Mike Acton "Data-Oriented Design and C++"

What do tech pioneers think about the AI revolution? - The Engineers, BBC World Service
▶︎

What do tech pioneers think about the AI revolution? - The Engineers, BBC World Service

Why I Quit Learning Languages
▶︎

Why I Quit Learning Languages

The Unity Tutorial For Complete Beginners
▶︎

The Unity Tutorial For Complete Beginners

HOLY ROSARY TODAY THURSDAY, JUNE 11, 2026 ST. JUDE THADDEUS & LUMINOUS MYSTERIES | DAILY HOLY ROSARY
▶︎

HOLY ROSARY TODAY THURSDAY, JUNE 11, 2026 ST. JUDE THADDEUS & LUMINOUS MYSTERIES | DAILY HOLY ROSARY

How AI Cracked the Protein Folding Code and Won a Nobel Prize
▶︎

How AI Cracked the Protein Folding Code and Won a Nobel Prize

Pushing Simulations to the LIMIT to Find Order in Chaos
▶︎

Pushing Simulations to the LIMIT to Find Order in Chaos

God Says:"STOP HERE — LISTEN AND HEAR ME SPEAK"/God Message Now/God Message
▶︎

God Says:"STOP HERE — LISTEN AND HEAR ME SPEAK"/God Message Now/God Message