macro_rules! export_plugin {
($logic:ty, $params:ty) => { ... };
}Expand description
Export the #[unsafe(no_mangle)] symbols the hot-reload shell binds.
The dylib no longer hands the shell a Box<dyn PluginLogicCore>
trait object. Instead it exports a flat set of Rust-ABI functions
that operate on an opaque state pointer (*mut (), an erased
Box<State>): the shell owns the state, so it can hold it across a
hot-reload code swap and run the freshly loaded code on the same
bytes (guarded by the truce_state_fingerprint export).
params_ptr is a raw Arc<Params> pointer from the shell; each call
borrows &Params from it (no refcount change - the shell keeps the
Arc alive for the call’s duration). Sample is the prelude’s
type Sample alias (f32 for prelude / prelude32 / prelude64m,
f64 for prelude64); the canary’s sample_precision byte guards a
precision-mismatched load.