-
#include "tensorstore/data_type.h" -
void* tensorstore::AllocateAndConstruct(
ptrdiff_t n,
ElementInitialization initialization,
DataType r); Allocates and initializes a contiguous 1-dimensional array of
nelements of typerspecified at run time.The memory must be freed by invoking
r->destroyand then calling::operator deletewith an alignment ofr->alignment.On failure to allocate memory, throws
std::bad_alloc, or terminates the process if exceptions are disabled.Note
For primitive types, default initialization leaves the elements uninitialized.