Skip to content
Try Kata

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.

Source, line 4

raw: RawPtr

Handle to the backing allocation.

Source, line 6

impl Ptr[@T]

Source, line 9

func read(self, index: Int): T

Read an initialized slot and validate the returned value against T.

Source, line 11

func write(self, index: Int, val: T)

Store a value in the selected slot. The raw allocation must still be live.

Source, line 16