MemViz v1.0.0
C++ Memory Layout Inspector
|
MemViz is a C++20 header-only reflection and memory layout inspection tool. It allows developers to introspect struct and class layouts at runtime, providing member offsets, type alignment, and more — all without macros inside your structs.
MEMVIZ_REGISTER
dumpLayout<T>()
requires
cpp MEMVIZ_REGISTER(Person, std::make_tuple( std::make_pair("age", &Person::age), std::make_pair("gender", &Person::gender), std::make_pair("height", &Person::height) ));
cpp Person p = {25, 'F', 170.5}; memviz::LayoutInspector::dumpLayout(p);
[Layout] Type: Person Size: 16 bytes Alignment: 8 bytes Location: 0x7ffee7... Members: age: offset = 0 gender: offset = 4 height: offset = 8
4608083138725496834 { x: 42, y: 3.14 } ```