_d_newitemU

Allocate an uninitialized non-array item.

This is an optimization to avoid things needed for arrays like the __arrayPad(size).

- _d_newitemU leaves the item uninitialized - _d_newitemT zero initializes the item - _d_newitemiT uses a non-zero initializer from TypeInfo

Used to allocate struct instances on the heap.

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

void main()
{
    new Sz(); // _d_newitemT(typeid(Sz))
    new Si(); // _d_newitemiT(typeid(Si))
}
extern (C) pure nothrow
void*
_d_newitemU
(
scope const TypeInfo _ti
)

Parameters

_ti TypeInfo

TypeInfo of item to allocate

Return Value

Type: void*

newly allocated item

Meta