mem.ptr
Typed access to a raw allocation. These wrappers do not establish ownership.
All modules · Writing docstrings
kind Ptr[T]A typed view of raw storage. The caller must preserve allocation lifetime and element types.
Ptr.raw
Section titled “Ptr.raw”raw: RawPtrHandle to the backing allocation.
Ptr[@T]
Section titled “Ptr[@T]”impl Ptr[@T]Ptr[@T].read
Section titled “Ptr[@T].read”func read(self, index: Int): TRead an initialized slot and validate the returned value against T.
Ptr[@T].write
Section titled “Ptr[@T].write”func write(self, index: Int, val: T)Store a value in the selected slot. The raw allocation must still be live.