|
|
|
|
|
by el_oni
903 days ago
|
|
There is a tsoding daily video with hot code reloading in C [0]. He dicusses techniques for this. one of which is a "migration" approach, similar to database migrations. Where, for example, you have a version number in your struct. and a function for migrating from an old version to a new version. I don't think he implements it in that video though. [0] https://www.youtube.com/watch?v=Y57ruDOwH1g&t=15s |
|
Video for how it works: https://www.youtube.com/watch?v=pjGngeKgni8
To migrate from one class version to another, I found the easiest way was to provide a callback method in the constructor where one could save the state from the old class, and read it into the new class. For example: https://github.com/jheruty/hscpp/blob/master/examples/simple...
Ultimately though the limitations of hot-swapping this way limits its usefulness. My understanding is that liveplusplus is much more full-featured.