<?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_realloc_func">
  <info>
    <link type="guide" xref="memory" group="function"/>
  </info>
  <title>bson_realloc_func</title>

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

  <section id="parameters">
    <title>Parameters</title>
    <table>
      <tr><td><p><code>mem</code></p></td><td><p>A memory region.</p></td></tr>
      <tr><td><p><code>num_bytes</code></p></td><td><p>A size_t containing the requested size.</p></td></tr>
      <tr><td><p><code>ctx</code></p></td><td><p>A consumer-specific pointer or <code>NULL</code>.</p></td></tr>
    </table>
  </section>

  <section id="description">
    <title>Description</title>
    <p>This is a prototype for pluggable realloc functions used through the Libbson library. If you wish to use a custom allocator this is one way to do it. Additionally, <code xref="bson_realloc_ctx">bson_realloc_ctx()</code> is a default implementation of this prototype.</p>
  </section>

</page>
