MongoDB C++ Driver legacy-1.0.0
|
The StackBufBuilder builds smaller datasets on the stack instead of using malloc. More...
#include <builder.h>
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 |
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.