.\" This manpage is Copyright (C) 2015 MongoDB, Inc.
.\" 
.\" Permission is granted to copy, distribute and/or modify this document
.\" under the terms of the GNU Free Documentation License, Version 1.3
.\" or any later version published by the Free Software Foundation;
.\" with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts.
.\" A copy of the license is included in the section entitled "GNU
.\" Free Documentation License".
.\" 
.TH "BSON_MALLOC0" "3" "2015-02-10" "libbson"
.SH NAME
bson_malloc0()
.SH "SYNOPSIS"

.nf
.nf
void *
bson_malloc0 (size_t num_bytes);
.fi
.fi

.SH "PARAMETERS"

.TP
.B .B num_bytes
A size_t.
.LP

.SH "DESCRIPTION"

This is a portable
.B malloc()
wrapper that also sets the memory to zero. Similar to
.B calloc()
\&.

In general, this function will return an allocation at least
.B sizeof(void*)
bytes or bigger.

If there was a failure to allocate
.B num_bytes
bytes, the process will be aborted.

.B NOTE
.RS
This function will abort on failure to allocate memory.
.RE

.SH "RETURNS"

A pointer to a memory region which
.BR HAS
been zeroed.


.BR
.SH COLOPHON
This page is part of libbson.
Please report any bugs at
\%https://jira.mongodb.org/browse/CDRIVER.