GC.sizeOf

size_t sizeOf( const scope void * p ) nothrow @nogc

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.

Parameters

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

Returns

The size in bytes of the memory block referenced by p or zero on error.
size_t sizeOf(void * p) pure nothrow @nogc

ditto