Skip to main content

extend_global_bindings

Function extend_global_bindings 

Source
pub fn extend_global_bindings(register: impl FnOnce(&mut KernelBindingTable))
Expand description

Add a backend’s dispatch wrappers to the process-wide binding table. Each backend exposes a register_*_kernels(table) function (see register_cpu_kernels); per-backend init paths call this to plug their wrappers into the global table.

Copy-on-write (GAP-015): clones the current table, runs register on the clone, then swaps the published Arc. Writers are serialized by BINDINGS_WRITER rather than by the RwLock, which is what keeps adopt_runtime_fused’s check-then-bind atomic while still leaving readers unblocked — see that static’s docs for why both properties are required. Readers in flight keep the pre-swap snapshot; they see this registration on their next call.