GC.addrOf

Returns the base address of the memory block containing p. This value is useful to determine whether p is an interior pointer, and the result may be passed to routines such as sizeOf which may otherwise fail. If p references memory not originally allocated by this garbage collector, if p is null, or if the garbage collector does not support this operation, null will be returned.

  1. inout(void)* addrOf(inout(void)* p)
    struct GC
    extern (D) static nothrow @nogc pure @trusted
    inout(void)*
    addrOf
    (
    inout(void)* p
    )
  2. void* addrOf(void* p)

Parameters

p inout(void)*

A pointer to the root or the interior of a valid memory block or to null.

Return Value

Type: inout(void)*

The base address of the memory block referenced by p or null on error.

Suggestion Box / Bug Report