You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
cppia: move live instances of a replaced class onto its replacement #265
When a newer module defines a class with the same name as an older one, instances created before keep the old class and its code, so replacing code in a running process only affects objects created afterwards.
An opt-in step at load or release time could retarget live instances of each replaced class to the new class when their layouts are compatible, and report the classes it could not move and why. Things to work through:
what counts as compatible: the same fields with the same types, and possibly new fields added at the end with default values;
field offsets, which cppia assigns per class (AlignOffset);
jitted code and vtables that hold the old class's functions;
closures and bound methods of the old class's methods;
interfaces the class implements, and how the collector marks instances through their class.
Moving this past 6.0.0. It needs a design before code: what counts as a compatible layout, what happens to jitted code and vtables that hold the old class's functions, and to closures and bound methods of its methods. As an opt-in step it would not change how modules load today.
Activity
dimensionscape commentedon Oct 22, 2026
Moving this past 6.0.0. It needs a design before code: what counts as a compatible layout, what happens to jitted code and vtables that hold the old class's functions, and to closures and bound methods of its methods. As an opt-in step it would not change how modules load today.
Move live instances onto a reloaded module's classes on request
Move live instances onto a reloaded module's classes on request
Move live instances onto a reloaded module's classes on request