xcalloc

Uses pureCalloc to allocate a block of memory of the given size and trows an outOfMemoryError if the memory cannot be allocated.

pure nothrow @trusted @nogc
void[]
xcalloc
(
size_t nitems
,
size_t size
)

Examples

t {

	ubyte[] bytes = cast(ubyte[])xcalloc(12, 1);
	assert(bytes.length == 12);

	int[] ints = cast(int[])xcalloc(3, 4);
	assert(ints.length == 3)

Meta