Pointer[A: A]

[Source]

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]

Constructors

create

[Source]

A null pointer.

new ref create()
: Pointer[A] ref^

Returns

Public Functions

offset

[Source]

Return a tag pointer to the n-th element.

fun tag offset(
  n: USize val)
: Pointer[A] tag

Parameters

Returns

usize

[Source]

Convert the pointer into an integer.

fun tag usize()
: USize val

Returns

is_null

[Source]

Return true for a null pointer, false for anything else.

fun tag is_null()
: Bool val

Returns

eq

[Source]

Return true if this address is that address.

fun tag eq(
  that: Pointer[A] tag)
: Bool val

Parameters

Returns

lt

[Source]

Return true if this address is less than that address.

fun tag lt(
  that: Pointer[A] tag)
: Bool val

Parameters

Returns

ne

[Source]

fun tag ne(
  that: Pointer[A] tag)
: Bool val

Parameters

Returns

le

[Source]

fun tag le(
  that: Pointer[A] tag)
: Bool val

Parameters

Returns

ge

[Source]

fun tag ge(
  that: Pointer[A] tag)
: Bool val

Parameters

Returns

gt

[Source]

fun tag gt(
  that: Pointer[A] tag)
: Bool val

Parameters

Returns

hash

[Source]

Returns a hash of the address.

fun tag hash()
: USize val

Returns

hash64

[Source]

Returns a 64-bit hash of the address.

fun tag hash64()
: U64 val

Returns

© 2016-2020, The Pony Developers
© 2014-2015, Causality Ltd.
Licensed under the BSD 2-Clause License.
https://stdlib.ponylang.io/builtin-Pointer