GC.disable

void disable() @safe nothrow pure;

Disables automatic garbage collections performed to minimize the process footprint. Collections may continue to occur in instances where the implementation deems necessary for correct program behavior, such as during an out of memory condition. This function is reentrant, but GC.enable() must be called once for each call to GC.disable(). Unlike the

@nogc attribute,

GC.disable() halts collections across all threads, yet still allows GC allocations. Disabling collections eliminates GC pauses.