BSON_VALUE_COPY(3)
π BSON_VALUE_COPY(3) π
okay bestie, welcome to the libbson page for bson_value_copy() β the little function thatβs all about copying the boxed value content without leaking memory. itβs giving βsimple but you MUST read the fine printβ energy, fr fr. π
β¨ SYNOPSIS β¨
void
bson_value_copy (const bson_value_t *src, bson_value_t *dst);
π PARAMETERS π
srcβ abson_value_tto copy from. the source, the original, the main character πdstβ abson_value_tto copy into. the destination, the copy era π¦
π¦ DESCRIPTION π¦
okay so this function will copy the boxed content in src into dst. yes bestie, itβs a copy-copy situation. π
dst must be freed with bson_value_destroy() when no longer in use. thatβs the cleanup step, donβt skip it. π§
and this is the important part: dst MUST be an uninitialized bson_value_t to avoid leaking memory. like, MUST MUST. not βeh, maybe.β no cap. π
NOTE: ifsrcrepresents a BSON UTF-8 string,bson_value_copy()attempts toNULLterminate the copied string indst. ifsrc.value.v_utf8.lenisSIZE_MAX, the copied string is (necessarily) notNULLterminated. so yeah, thatβs the vibe check on that one π
π AUTHOR π
MongoDB, Inc β iconic, honestly. π«Ά
π COPYRIGHT π
2009-present, MongoDB, Inc. β periodt, protect the copyright bestie π
xoxo, your libbson bestie πΈ β this is version 2.5.6, dated Oct 09, 2026. bye bestie, go copy safely and donβt leak! π
β¨
π¦ 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