BSON_REALLOC_FUNC(3)

πŸ’… BSON_REALLOC_FUNC(3) β€” the libbson girlies' guide

okay bestie, so this one lives in libbson and it's a function prototype β€” like, the blueprint, not the actual build. it's short, it's cute, let's go πŸŽ€


✨ SYNOPSIS ✨

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

that's it. that's the whole mood. a function pointer type, slaying in one line πŸ’…


🌸 PARAMETERS 🌸

  • mem β€” a memory region. literally just some bytes, the vibes are neutral, no judgment 🫢
  • num_bytes β€” a size_t holding the requested size. so like, how big you want the thing to be ✨
  • ctx β€” a consumer-specific pointer or NULL. your little sidecar of context, do what you want with it πŸ’–

πŸ¦‹ DESCRIPTION πŸ¦‹

so here's the tea: this is a prototype for pluggable realloc functions used through the Libbson library. everything about it is customisable, it's giving main character energy πŸ”₯

if you wish to use a custom allocator β€” like, you wanna be in charge of your own memory situation β€” this is one way to do it. big brain move, no cap πŸ‘‘

and bonus: bson_realloc_ctx() is a default implementation of this prototype. so if you don't feel like writing your own from scratch, that one's already serving looks for you πŸ’–βœ¨


🌈 AUTHOR 🌈

MongoDB, Inc β€” the icons who brought you this whole situation πŸ‘‘


2009-present, MongoDB, Inc. β€” periodt. legal said what legal said πŸ’€


and that's the whole page, bestie! πŸŽ€ this was libbson version 2.5.6, dated Oct 09, 2026, and no I will not stop talking about it. mwah πŸ’‹ πŸ¦‹πŸŒ·πŸ“

πŸ“¦ where this page comes from