MongoDB C++ Driver legacy-1.1.2
Loading...
Searching...
No Matches
List of all members
mongo::StackBufBuilder Class Reference

The StackBufBuilder builds smaller datasets on the stack instead of using malloc. More...

#include <builder.h>

+ Inheritance diagram for mongo::StackBufBuilder:

Additional Inherited Members

- Public Member Functions inherited from mongo::_BufBuilder< StackAllocator >
char * skip (int n)
 leave room for some stuff later
 
int len () const
 
int getSize () const
 
void reserveBytes (int bytes)
 Reserve room for some number of bytes to be claimed at a later time.
 
void claimReservedBytes (int bytes)
 Claim an earlier reservation of some number of bytes.
 

Detailed Description

The StackBufBuilder builds smaller datasets on the stack instead of using malloc.

this can be significantly faster for small bufs. However, you can not decouple() the buffer with StackBufBuilder. While designed to be a variable on the stack, if you were to dynamically allocate one, nothing bad would happen. In fact in some circumstances this might make sense, say, embedded in some other object.


The documentation for this class was generated from the following file: