GC.allocatedInCurrentThread

Returns the number of bytes allocated for the current thread since program start. It is the same as GC.stats().allocatedInCurrentThread, but faster.

struct GC
extern (C) pragma(mangle, "gc_allocatedInCurrentThread") static nothrow
ulong
allocatedInCurrentThread
()

Examples

Using allocatedInCurrentThread

ulong currentlyAllocated = GC.allocatedInCurrentThread();
struct DataStruct
{
    long l1;
    long l2;
    long l3;
    long l4;
}
DataStruct* unused = new DataStruct;
assert(GC.allocatedInCurrentThread() == currentlyAllocated + 32);
assert(GC.stats().allocatedInCurrentThread == currentlyAllocated + 32);

Meta