bson_array_alloc0 - Man Page

Synopsis

#define BSON_ARRAY_ALLOC0(Count, Type) \
   (Type*) bson_array_alloc0 (Count, sizeof (Type))

void *
bson_array_alloc0 (size_t num_elems, size_t elem_size);

Parameters

Description

This is a portable calloc() wrapper to allocate an array of objects that also sets the memory to zero.

If num_elems * elem_size cannot be represented in a size_t or there was a failure to allocate num_elems * elem_size bytes, the process will be aborted.

Warning:

This function will abort on failure to allocate memory.

Returns

A pointer to a memory region which HAS been zeroed.

Author

MongoDB, Inc

Info

Mar 04, 2026 2.2.3 libbson