builtin Pointer - tadashi9e/gmp4pony GitHub Wiki
A Pointer[A] is a raw memory pointer. It has no descriptor and thus can't be included in a union or intersection, or be a subtype of any interface. Most functions on a Pointer[A] are private to maintain memory safety.
struct ref Pointer[A: A]A null pointer.
new ref create()
: Pointer[A] ref^- Pointer[A] ref^
Return a tag pointer to the n-th element.
fun tag offset(
n: USize val)
: Pointer[A] tag- n: USize val
- Pointer[A] tag
Convert the pointer into an integer.
fun tag usize()
: USize val- USize val
Return true for a null pointer, false for anything else.
fun tag is_null()
: Bool val- Bool val
Return true if this address is that address.
fun tag eq(
that: Pointer[A] tag)
: Bool val- that: Pointer[A] tag
- Bool val
Return true if this address is less than that address.
fun tag lt(
that: Pointer[A] tag)
: Bool val- that: Pointer[A] tag
- Bool val
fun tag ne(
that: Pointer[A] tag)
: Bool val- that: Pointer[A] tag
- Bool val
fun tag le(
that: Pointer[A] tag)
: Bool val- that: Pointer[A] tag
- Bool val
fun tag ge(
that: Pointer[A] tag)
: Bool val- that: Pointer[A] tag
- Bool val
fun tag gt(
that: Pointer[A] tag)
: Bool val- that: Pointer[A] tag
- Bool val
Returns a hash of the address.
fun tag hash()
: USize val- USize val
Returns a 64-bit hash of the address.
fun tag hash64()
: U64 val- U64 val