Scoop API

scoop:scoop.core:0.1.0

Ptr

struct Ptr

source · line 10
public
public struct Ptr<T : value> : Equals<Ptr<T>>

A typed native data address. Unsafe users must ensure valid lifetime, alignment, bounds, and access permissions; pointer values do not own or root their pointees.

function cast

source · line 33
public
@NoGC
    @Unsafe
    @Intrinsic("ptr_cast")
    public fun <U : value> cast(): Ptr<U>

Reinterprets the same address with another pointee type. The caller must establish the new type's alignment and access validity.

function store

source · line 60
public
@NoGC
    @Unsafe
    @Intrinsic("ptr_store")
    public fun store(value: T): Unit

Writes a value at this address or the specified element offset. The caller must provide writable, properly aligned storage.

function minus

source · line 85
public
@NoGC
    @Unsafe
    @Intrinsic("ptr_minus")
    public operator fun minus(offset: Long): Ptr<T>

Moves backward by offset elements of T, not bytes. It does not check allocation bounds.

function toULong

source · line 24
public
@NoGC
    @Unsafe
    @Intrinsic("ptr_to_ulong")
    public fun toULong(): ULong

Returns the address as an unsigned integer without extending the pointee's lifetime.

function plus

source · line 77
public
@NoGC
    @Unsafe
    @Intrinsic("ptr_plus")
    public operator fun plus(offset: Long): Ptr<T>

Moves forward by offset elements of T, not bytes. It does not check allocation bounds.

function load

source · line 51
public
@NoGC
    @Unsafe
    @Intrinsic("ptr_load_offset")
    public fun load(offset: Long): T

Reads a value at this address or the specified element offset. The caller must provide readable, properly aligned initialized storage.

function store

source · line 69
public
@NoGC
    @Unsafe
    @Intrinsic("ptr_store_offset")
    public fun store(offset: Long, value: T): Unit

Writes a value at this address or the specified element offset. The caller must provide writable, properly aligned storage.

function load

source · line 42
public
@NoGC
    @Unsafe
    @Intrinsic("ptr_load")
    public fun load(): T

Reads a value at this address or the specified element offset. The caller must provide readable, properly aligned initialized storage.