C++ Runtime [patched] -

(simplified for a class hierarchy A <- B ):

vtable for B: [0] offset_to_top = 0 [1] typeinfo pointer -> typeinfo for B [2] A::foo() thunk (if overriding) vtable for A: [0] offset_to_top = 0 [1] typeinfo pointer -> typeinfo for A c++ runtime

must return a pointer to the start of the most derived object. The runtime computes this by following a “offset to top” field stored in the vtable. (simplified for a class hierarchy A &lt;- B

Compiler transforms to:

static Logger& getLogger() static Logger instance; // thread‑safe initialization return instance; // thread‑safe initialization return instance