You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
My DLL entry point returns a Plugin trait object that the host takes ownership of.
And yes, I drop this trait object before unloading the DLL.
My question is, can I still use this crate?
Do I even need to, when host and plugin are always compiled with the same nightly?
(Does it make a difference if the DLL is a dylib or cdylib regarding ABI stability guarantee?)
Everything seems to work fine when using cdylib and compiling with the same nightly, even without marshalling my types across the DLL boundary, but people told me the ABI could change even between different invocations of the same rustc.
The text was updated successfully, but these errors were encountered:
What you quoted means that if you use abi_stable's safe functions for loading dynamic libraries, you can't unload the dynamic library.
You can still use data structures from the crate in your project that unloads dynamic libraries. you have to ensure all* objects from the dynamic library are dropped before unloading it though, which you seem to be doing already.
*This means all abi_stable types that have vtables, or other values contaning pointers to static memory of the dynamic library.
Does this mean using this crate when my plugins should support unloading would be unsafe?
In my use case I'm using this crate to auto-reload recompiled plugins:
https://crates.io/crates/dynamic_reload
My DLL entry point returns a
Plugin
trait object that the host takes ownership of.And yes, I drop this trait object before unloading the DLL.
My question is, can I still use this crate?
Do I even need to, when host and plugin are always compiled with the same nightly?
(Does it make a difference if the DLL is a
dylib
orcdylib
regarding ABI stability guarantee?)Everything seems to work fine when using
cdylib
and compiling with the same nightly, even without marshalling my types across the DLL boundary, but people told me the ABI could change even between different invocations of the same rustc.The text was updated successfully, but these errors were encountered: