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§
- Roam
Mmap Attachments - Guest-side mmap attachments resolved by (map_id, map_generation).
- Roam
ShmBootstrap Response Info - Roam
Size Class - A size class descriptor for variable-size slot pools.
- Roam
VarSlot Handle - Handle to an allocated variable-size slot.
- Roam
VarSlot Pool - 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
lenpreviously 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_ptrfollowed bycapacitybytes 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
lenbytes from the consumer side. - roam_
bipbuf_ ⚠try_ grant - Try to reserve
lenbytes 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
sizebytes. - 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.