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β asize_tholding the requested size. so like, how big you want the thing to be β¨ctxβ a consumer-specific pointer orNULL. 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 π
β COPYRIGHT β
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
- epel 10: libbson-devel 2.5.6-1.el10_3 Β· Apache-2.0 AND ISC AND MIT AND Zlib
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms