Skip to main content

Crate roam_shm_ffi

Crate roam_shm_ffi 

Source
Expand description

C bindings for roam shared-memory primitives.

Exposes BipBuffer operations, VarSlotPool management, and atomic helpers through a C ABI so that Swift (and other FFI consumers) can use the Rust implementations as the single source of truth.

This crate is Unix-only; on other platforms it compiles to an empty library.

Structs§

RoamMmapAttachments
Guest-side mmap attachments resolved by (map_id, map_generation).
RoamShmBootstrapResponseInfo
RoamSizeClass
A size class descriptor for variable-size slot pools.
RoamVarSlotHandle
Handle to an allocated variable-size slot.
RoamVarSlotPool
Opaque wrapper around the Rust VarSlotPool (heap-allocated, Box’d).

Functions§

roam_atomic_compare_exchange_u32
Safety
roam_atomic_compare_exchange_u64
Safety
roam_atomic_fetch_add_u32
Safety
roam_atomic_load_u32_acquire
Safety
roam_atomic_load_u64_acquire
Safety
roam_atomic_store_u32_release
Safety
roam_atomic_store_u64_release
Safety
roam_bipbuf_capacity
Safety
roam_bipbuf_commit
Commit len previously granted bytes, making them visible to the consumer.
roam_bipbuf_header_size
roam_bipbuf_init
Initialize a BipBuffer header. The caller must provide a zeroed 128-byte region at header_ptr followed by capacity bytes of data space.
roam_bipbuf_load_read_acquire
Safety
roam_bipbuf_load_watermark_acquire
Safety
roam_bipbuf_load_write_acquire
Safety
roam_bipbuf_release
Release len bytes from the consumer side.
roam_bipbuf_try_grant
Try to reserve len bytes for writing.
roam_bipbuf_try_read
Try to read contiguous bytes from the buffer.
roam_mmap_attachments_create
Create a guest-side mmap attachment registry from a control socket fd.
roam_mmap_attachments_destroy
Destroy mmap attachments and free all attached mapping resources.
roam_mmap_attachments_drain_control
Drain all pending mmap attach messages from the control socket.
roam_mmap_attachments_resolve_ptr
Resolve an mmap-ref tuple to a direct payload pointer.
roam_mmap_control_send
Send one mmap attach message (fd + map metadata) over a Unix control socket.
roam_shm_bootstrap_request_decode
Decode a bootstrap request frame and expose SID location in the input buffer.
roam_shm_bootstrap_request_encode
Encode a bootstrap request frame (RSH0 + sid length + sid bytes).
roam_shm_bootstrap_request_header_size
roam_shm_bootstrap_response_decode
Decode a bootstrap response frame and expose payload location in the input buffer.
roam_shm_bootstrap_response_encode
Encode a bootstrap response frame (RSP0 + status + peer + payload length + payload).
roam_shm_bootstrap_response_header_size
roam_shm_bootstrap_response_recv_unix
Receive one bootstrap response on a Unix control socket.
roam_shm_bootstrap_response_send_unix
Send one bootstrap response on a Unix control socket.
roam_var_slot_pool_alloc
Allocate a slot that can hold size bytes.
roam_var_slot_pool_attach
Create a VarSlotPool view over an existing shared memory region.
roam_var_slot_pool_calculate_size
Calculate the total size needed for a variable slot pool (extent 0 only).
roam_var_slot_pool_destroy
Destroy a VarSlotPool, freeing its heap allocation.
roam_var_slot_pool_free
Free an in-flight slot back to its pool.
roam_var_slot_pool_free_allocated
Free an allocated (never sent) slot back to its pool.
roam_var_slot_pool_init
Initialize all extent-0 slots and free lists. Call once during segment creation.
roam_var_slot_pool_mark_in_flight
Transition a slot from Allocated to InFlight.
roam_var_slot_pool_payload_ptr
Get a pointer to the slot’s payload data area.
roam_var_slot_pool_recover_peer
Recover all slots owned by a crashed peer.
roam_var_slot_pool_slot_size
Get the slot size for a given class index.
roam_var_slot_pool_slot_state
Get the current state of a slot.
roam_var_slot_pool_update_region
Update the region pointer after a resize/remap.