“dynamic_cast From Scratch”
summary
Builds a complete, bug‑free reimplementation of dynamic_cast using the Itanium C++ ABI and a small set of nonportable helpers, exposes where compilers waste work (e.g. missed final optimizations), and replaces the library graph search with hand-crafted RTTI tables plus a tiny dispatch function. Tests use a Python fuzzer and end-to-end benchmarks; results show identical void* codegen and faster results for many real casts, with source and examples on GitHub.
AI-written summary · about
chapters (12)
- 0:00Introduction
- 0:26Polymorphism basics
- 4:21Multiple & virtual inheritance
- 7:03Object layout & v-tables
- 12:17RTTI and v-table data
- 19:24Visualizing class hierarchies
- 25:12Dynamic cast behavior
- 31:44Implementing casting
- 37:50Runtime graph algorithms
- 42:06Accessibility and finalization
- 52:24Performance benchmarks
- 56:04Q&A and conclusion
related talks
01h 00mType punning in modern C++
22mRevisiting Dynamic Dispatch for Modern Architectures
54mThe C++ ABI From the Ground Up
01h 39m“Thoughts on a more powerful and simpler C++ (5 of N)”
01h 07mDynamic Polymorphism With Code Injection and Metaclasses
26m“Easy::Jit: A Just-in-Time compilation library for C++”
59mCompilers can be surprising
30mAn Incremental Approach to JIT Construction
