_d_newitemT

fnT * _d_newitemT(T)() @trusted

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
}

Returns

newly allocated item