folly::checkedMalloc

Trivial wrapper around malloc that check for allocation failure and throw std::bad_alloc in that case.

Synopsis

Declared in <folly/memory/Malloc.h>

void*
checkedMalloc(size_t size);

Description

methodset Allocation Wrappers

Return Value

void* pointer to allocated buffer

Parameters

NameDescription
sizesize of allocation