Using the Dynlink API to re-load code

I’m building a library where it makes sense to be able to have code that can be reloaded at runtime.

I was curious if anyone has been able to use the Dynlink library to achieve anything like that?

From what I’ve tried so far, I get namespacing errors with loadfile (something like Module already loaded), and, while loadfile_private seems to solve the “load more than once” problem, it brings along extra constraints that aren’t really viable to my use case.

Thanks for your help!


I don’t think this is possible. I am afraid loadfile_private is the only game in town, but you will be left with several copies of your code in memory.

Best wishes,

1 Like