Allocate uninitialized storage for n instances of T, suitably aligned for T.

Synopsis

Declared in <folly/memory/Malloc.h>

template<typename T>
T*
checkedArrayMalloc(size_t n);

Description

Throws std::bad_array_new_length if n * sizeof(T) would overflow size_t, std::bad_alloc on allocation failure.

methodset Allocation Wrappers

Return Value

T* pointer to the uninitialized buffer

Parameters

Name

Description

n

Number of T instances.

Created with MrDocs