GC.qalloc

Requests an aligned block of managed memory from the garbage collector. This memory may be deleted at will with a call to free, or it may be discarded and cleaned up automatically during a collection run. If allocation fails, this function will call onOutOfMemory which is expected to throw an OutOfMemoryError.

struct GC
version(D_ProfileGC)
extern (C) pragma(mangle, "gc_qallocTrace") static pure nothrow
qalloc
(
size_t sz
,
uint ba = 0
,
const scope TypeInfo ti = null
,
string file = __FILE__
,
int line = __LINE__
,
string func = __FUNCTION__
)

Parameters

sz size_t

The desired allocation size in bytes.

ba uint

A bitmask of the attributes to set on this block.

ti TypeInfo

TypeInfo to describe the memory. The GC might use this information to improve scanning for pointers or to call finalizers.

Return Value

Type: BlkInfo

Information regarding the allocated memory block or BlkInfo.init on error.

Throws

OutOfMemoryError on allocation failure.

Meta