---
name: "bson_realloc_func"
section: "3"
platform: "linux"
package: "libbson-doc"
version: "1.30.4-1+deb13u3"
release: "Debian 13 (Trixie)"
platforms: ["linux"]
url: "https://new.carta.tech/bson_realloc_func"
---

# bson\_realloc\_func(3)

## SYNOPSIS

```
typedef void *(*bson_realloc_func) (void *mem, size_t num_bytes, void *ctx);
```

## PARAMETERS

- •

  **mem**: A memory region.

- •

  **num\_bytes**: A size\_t containing the requested size.

- •

  **ctx**: A consumer-specific pointer or **NULL**.

## DESCRIPTION

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, *bson\_realloc\_ctx()* is a default implementation of this prototype.

## AUTHOR

MongoDB, Inc

## COPYRIGHT

2009-present, MongoDB, Inc.
