logos.mem.sync

Module mem · package logos-mem

Types

structArc

struct Arc

Atomically reference-counted shared-ownership pointer; Send/Sync when T: Send + Sync.

Implements: Send Sync Drop Clone Deref DerefMut

Fields

inner: *mut ArcInner<T>

structArcInner

struct ArcInner

Heap control block shared by Arc<T>/Weak<T>: atomic strong/weak counters, then the value.

Fields

strong: AtomicI32
val: T
weak: AtomicI32

structWeak

struct Weak

Non-owning, thread-safe handle to an Arc allocation; breaks Arc cycles. upgrade() yields Some(Arc) only while a strong reference survives.

Implements: Drop Clone Send Sync Drop Clone

Fields

inner: *mut ArcInner<T>

Functions

fnarc_from_raw_inner

fn arc_from_raw_inner(inner: *mut ArcInner<T>) -> Arc<T>

Reconstructs an owning Arc<T> from a raw control-block pointer, taking a new strong share. inner must point at a live ArcInner<T>; for unsized T the fat pointer carries the metadata (vtable/len).

fnarc_new

fn arc_new(val: T) -> Arc<T>

Creates a new Arc<T> owning val, with a single strong share.

fnarc_new_uninit

fn arc_new_uninit() -> Arc<T>

Allocates an Arc<T> control block (strong = weak = 1) with the value uninitialised. Caller must initialise the value in place (data_u8/DerefMut) before the Arc is read or dropped.