Closed kurtlawrence closed 4 years ago
Renaming was done previously to solve a different issue, the reasoning is kept here.
[Renaming] Has to be done to make linux builds work see:
- https://github.com/nagisa/rust_libloading/issues/5
- https://github.com/nagisa/rust_libloading/issues/41
- https://github.com/nagisa/rust_libloading/issues/49
Basically the api function
dlopen
will keep loaded libraries in memory to avoid continuously allocating memory. It only does not release the library when threadlocal data is hanging around, and it seemsprintln!()
is something that does this. Hence to avoid not having the library not updated with a newnew()
call, a different lib name is passed to the function. This is very annoying as it has needless fs interactions and a growing fs footprint but> what can you do ¯_(ツ)/¯
There is a very specific use case which can result in segfaults. The implementer must send through an object such as a channel that can be sent some actionable thing. Once the papyrus code finishes, if this code is called it will be called on invalid memory (as the library has been dropped at this point).
The solution may be to store loaded libraries, and give the ability to clear the cache at user defined points. Storing would not be the preferred option so would have to be opted into.
Todo: