<?xml version="1.0"?>
<page xmlns="http://projectmallard.org/1.0/"
      type="topic"
      style="function"
      xmlns:api="http://projectmallard.org/experimental/api/"
      xmlns:ui="http://projectmallard.org/experimental/ui/"
      id="bson_malloc">
  <info>
    <link type="guide" xref="memory" group="function"/>
  </info>
  <title>bson_malloc()</title>

  <section id="synopsis">
    <title>Synopsis</title>
    <synopsis><code mime="text/x-csrc"><![CDATA[void *
bson_malloc (size_t num_bytes);
]]></code></synopsis>
  </section>

  <section id="parameters">
    <title>Parameters</title>
    <table>
      <tr><td><p><code>num_bytes</code></p></td><td><p>A size_t containing the number of bytes to allocate.</p></td></tr>
    </table>
  </section>

  <section id="description">
    <title>Description</title>
    <p>This is a portable <code>malloc()</code> wrapper.</p>
    <p>In general, this function will return an allocation at least <code>sizeof(void*)</code> bytes or bigger.</p>
    <p>If there was a failure to allocate <code>num_bytes</code> bytes, the process will be aborted.</p>
    <note style="warning"><p>This function will abort on failure to allocate memory.</p></note>
  </section>

  <section id="returns">
    <title>Returns</title>
    <p>A pointer to a memory region which <em>HAS NOT</em> been zeroed.</p>
  </section>

</page>
