Skip to main content

Module slot

Module slot 

Source
Expand description

ValueSlot: 8-byte raw value storage for TypedObject fields

Each slot stores exactly 8 bytes of raw bits. Simple types (f64, i64, bool) use their native bit representation. Heap types are stored as the raw pointer of an Arc<T> produced by Arc::into_raw, where T is the exact typed payload (e.g. String, HashMapData, Decimal; for array fields post-V3-S5, TypedArray<f64>/TypedArray<i64> /etc. per the v2-raw per-element-kind carrier shape). Drop dispatch consults the schema’s FieldType / NativeKind to pick the matching Arc::decrement_strong_count; there is no Box<HeapValue> wrapping in new code.

The slot itself does NOT self-describe its type. TypedObject’s heap_mask bitmap identifies which slots contain heap pointers (bit N set = slot N is heap).

ADR-006 §2.4: per-FieldType constructors. Per-HeapValue-variant constructors mirror the typed Arc<T> payloads on HeapValue. from_heap is #[deprecated] transitional — new code uses the typed constructors below. See docs/adr/006-value-and-memory-model.md.

Structs§

ValueSlot
A raw 8-byte value slot for TypedObject field storage.