Closed dannypsnl closed 1 year ago
Linearity is enforced dynamically by the component model's lifting/lowering rules; in particular, lifting an own
handle removes (clears) the element in the source component instance's handle table such that subsequent uses of the same i32
handle index by core wasm will fail. You can see this dynamic logic in the Python pseudo-code described in CanonicalABI.md (see lift_own
, which transitively calls transfer_or_drop
). Thus, it's up to the source language toolchain/bindings to figure out how to avoid the error conditions either by static typing or dynamic proxy-object semantics (or not prevent it at all, as would be the case for C).
This is a wrong question (by misunderstood own/borrow of CM), close this for now
ownership & moving approach is only safe with linearly, how does component model ensure each component implements it?