GC.sizeOf

Returns the true size of the memory block referenced by p. This value represents the maximum number of bytes for which a call to realloc may resize the existing block in place. If p references memory not originally allocated by this garbage collector, points to the interior of a memory block, or if p is null, zero will be returned.

  1. size_t sizeOf(void* p)
    struct GC
    extern (D) static nothrow @nogc
    size_t
    sizeOf
    (
    const scope void* p
    )
  2. size_t sizeOf(void* p)

Parameters

p void*

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

Return Value

Type: size_t

The size in bytes of the memory block referenced by p or zero on error.

Meta