#[unsafe(no_mangle)]pub unsafe extern "C" fn jit_alloc_shared_cell(
_initial_bits: u64,
) -> u64Expand description
Allocate a fresh Arc<SharedCell> from initial_bits and return
the raw pointer bits of the strong share.
The returned pointer is owned by the caller’s slot; it MUST be
released via jit_arc_shared_release exactly once when the slot
exits scope. ValueWord::from_bits(initial_bits) seeds the cell’s
inner payload; subsequent reads/writes go through the lock-gated
pointer-deref lowering in mir_compiler/places.rs.
§Safety
initial_bitsis a rawValueWordbit pattern. If the bits encode a heap-refcounted pointer, the caller must ensure the appropriate refcount share was already taken — this FFI does not retain or release heap refs on the payload.- The returned pointer is 8-byte aligned (Arc + repr(C) SharedCell) and non-null (Arc::new never returns null).
- The returned pointer is the sole strong share owned by the
caller’s slot;
jit_arc_shared_releaseis the sole releaser. Additional shares (one per capturing closure) are minted viajit_arc_shared_retainand balanced byrelease_typed_closureon closure drop.