heapAlloc

Allocates class or struct on the heap. It automatically emplaces it to tyhe allocated memory with provided args. On error, onOutOfMemoryError assert is called.

When gcRoot is set, it also sets the memory range to be scanned by GC for pointers (off by default).

@trusted
heapAlloc
(
T
Args...
)
(
Args args
)
if (
is(T == struct)
)

Meta