BSON_ALIGNED_ALLOC(3)
okay bestie, welcome to the BSON_ALIGNED_ALLOC(3) page in the libbson manual π this one is short and iconic, so letβs get into it.
β¨ SYNOPSIS β¨
void *
bson_aligned_alloc (size_t alignment, size_t num_bytes);
π PARAMETERS π
alignmentβ the alignment of the allocated bytes of memory. It must be a power of 2 and a multiple ofsizeof (void *). Like, no cap, those are the rules bestie.num_bytesβ the number of bytes to allocate. It must be a multiple ofalignment. Periodt.
πΈ DESCRIPTION πΈ
This is a portable aligned_alloc() wrapper. Itβs giving convenience, but with rules.
If there was a failure to allocate num_bytes bytes aligned to alignment, the process will be aborted. Not a drill, bestie.
β οΈ WARNING: This function will abort on failure to allocate memory. Like, literally abort. π
π¦ RETURNS π¦
A pointer to a memory region which HAS NOT been zeroed. Read that again, bestie: HAS NOT been zeroed. So donβt assume itβs all clean and zeroed out β it is not. π
π AUTHOR π
MongoDB, Inc
π COPYRIGHT π
2009-present, MongoDB, Inc.
okay thatβs the whole page, bestie β mwah π this libbson page is version 2.5.6, dated Oct 09, 2026. slay and stay aligned β¨
π¦ 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