Skip to main content

MX_ALTREP_REGISTRATIONS

Static MX_ALTREP_REGISTRATIONS 

Source
pub static MX_ALTREP_REGISTRATIONS: DistributedSlice<[AltrepRegistration]>
Expand description

ALTREP class registration entries, called once at package init.

Each ALTREP struct or trait impl emits an entry pairing the registration function pointer with its #[no_mangle] symbol name. The fn is declared pub extern "C" with #[unsafe(no_mangle)], making it externally addressable from a separate compilation unit (e.g. the WASM snapshot codegen path). The fn pointer is not unsafe — R-thread invariants are a module-level contract, not encoded in the type (same convention as the extern "C-unwind" fn entries in MX_CALL_DEFS). The symbol string is consumed by the host-time WASM snapshot writer to emit extern "C" { fn <symbol>(); } declarations in wasm_registry.rs.