_d_newitemT

Allocate an initialized non-array item.

This is an optimization to avoid things needed for arrays like the __arrayPad(size). Used to allocate struct instances on the heap.

struct Sz {int x = 0;}
struct Si {int x = 3;}

void main()
{
    new Sz(); // uses zero-initialization
    new Si(); // uses Si.init
}
@trusted
T*
_d_newitemT
(
T
)
()

Return Value

Type: T*

newly allocated item

Meta