GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages
BSON_DESTROY_WITH_STEAL(3) libbson BSON_DESTROY_WITH_STEAL(3)

uint8_t *
bson_destroy_with_steal (bson_t *bson, bool steal, uint32_t *length);


  • bson: A bson_t.
  • steal: A bool indicating if the underlying buffer should be stolen.
  • length: A location for storing the resulting buffer length.

The bson_destroy_with_steal() function shall destroy a bson_t structure but return the underlying buffer instead of freeing it. If steal is false, this is equivalent to calling bson_destroy(). It is a programming error to call this function on a bson_t that is not a top-level bson_t, such as those initialized with bson_append_document_begin(), bson_append_array_begin(), and bson_writer_begin().

bson_destroy_with_steal() shall return a buffer containing the contents of the bson_t if steal is non-zero. This should be freed with bson_free() when no longer in use. length will be set to the length of the bson document if non-NULL.

SEE ALSO:

bson_steal(), a higher-level function that efficiently transfers the contents of one bson_t to another.



MongoDB, Inc

2009-present, MongoDB, Inc.

July 3, 2025 1.30.4

Search for    or go to Top of page |  Section 3 |  Main Index

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with ManDoc.