I want to be able to generate C code dynamically and re-load it quickly into my running C program.
I am on Linux, how could this be done?
Can a library .so f
If you want to reload a library dynamically, you can use dlopen
function (see mans). It opens a library .so file and returns a void* pointer to it, then you can get a pointer to any function/variable of your library with dlsym
.
To compile your libraries in-memory, well, the best thing I think you can do is creating memory filesystem as described here.