I have .so files that inside of them use some STL containers.
Problem is that I’m interested in live unloading of version X of .so and replacing it with version Y of .so, but without losing data. If the data was just raw memory I could just forward the pointers while switching, but I would like to use regular STL containers. Is there any way to do it. Copying is not a problem, as long as the data contained can be transferred.
Also will static destructors be activated when I unload the old .so?
I have .so files that inside of them use some STL containers. Problem is
Share
1) Have X.so save it’s data to a file (with a version number!), unload X.so, load Y.so, have Y.so load the data from the file.
2) have version names instead, load both, have Y.so fill it’s containers directly from X.so’s containers (check the version number!), then unload X.so.
I really do not recommend passing the containers directly, as if the ABI’s are incompatible for any reason, it will compile fine, but crash at runtime. This also makes it easier to deliberately change ABIs.