folly::checkedCalloc

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

Synopsis

Declared in <folly/memory/Malloc.h>

void*
checkedCalloc(
    size_t n,
    size_t size);

Description

methodset Allocation Wrappers

Return Value

void* pointer to allocated buffer

Parameters

NameDescription
nNumber of elements
sizeSize of each element