#[repr(C)]pub struct AbiCanary {Show 20 fields
pub trait_object_size: usize,
pub audio_buffer_size: usize,
pub process_context_size: usize,
pub process_status_size: usize,
pub event_size: usize,
pub event_body_size: usize,
pub transport_size: usize,
pub widget_region_size: usize,
pub theme_size: usize,
pub plugin_layout_size: usize,
pub color_size: usize,
pub vec_u8_size: usize,
pub option_usize_size: usize,
pub audio_buffer_align: usize,
pub process_status_align: usize,
pub result_normal_disc: u8,
pub result_tail_disc: u8,
pub result_keepalive_disc: u8,
pub rustc_version_hash: u64,
pub sample_precision: u8,
}Expand description
ABI fingerprint. Compared between shell and dylib before loading.
This is the ONE #[repr(C)] type in the system - it’s the
bootstrap verification struct that makes everything else safe.
Fields§
§trait_object_size: usize§audio_buffer_size: usize§process_context_size: usize§process_status_size: usize§event_size: usize§event_body_size: usize§transport_size: usize§widget_region_size: usize§theme_size: usize§plugin_layout_size: usize§color_size: usize§vec_u8_size: usize§option_usize_size: usize§audio_buffer_align: usize§process_status_align: usize§result_normal_disc: u8§result_tail_disc: u8§result_keepalive_disc: u8§rustc_version_hash: u64§sample_precision: u8Bit-width of the plugin’s chosen sample type - 32 for f32,
64 for f64. Without this field, a shell built against
prelude (f32) loading a logic dylib built against prelude64
would bind to a vtable whose process() slot expects
AudioBuffer<f64> - silent UB on the first audio block. The
width difference between the two AudioBuffer<S> instantiations
(and dyn PluginLogic<S>) is invisible at the dyn-trait
boundary, so a structural canary alone wouldn’t catch it.
Implementations§
Source§impl AbiCanary
impl AbiCanary
Sourcepub fn current<S: Sample>() -> Self
pub fn current<S: Sample>() -> Self
Build the canary for a specific sample precision S. The
shell calls this with its own S; the dylib’s
truce_abi_canary export does the same with its own (from the
prelude alias). The two are compared at load time.