top | item 38860317

(no title)

tsmeets | 2 years ago

You don't need anything complicated for this. All you need is to compile your code to a shared library that exports an 'update' method.

See https://github.com/TomSmeets/quest-for-nothing/blob/master/a...

You have to be careful with global variables however, they will get cleared to zero when the code is reloaded. To solve this either don't use globals or just restore them on reload.

discuss

order

tivolo|2 years ago

Not having globals at all or restoring them on reload isn't exactly "don't need anything complicated for this", especially considering using a generic hot-reload tool on AAA 5M+ LOC projects.

There's no easy way to retrofit hot-reload into these large codebases. Sure, it's easier if you design everything up-front with hot-reloading in mind, but it's still going to be hard to convince developers that they cannot use globals, thread-local storage, function statics, or other inherently stateful things that just won't work with DLL reloading.

MuffinFlavored|2 years ago

Any other "stateful" issues you've ran into?