sajson
High-Performance JSON Parser
Public Member Functions | List of all members
sajson::bounded_allocation Class Reference

Allocation policy that attempts to fit the parsed AST into an existing memory buffer. More...

#include <sajson.h>

Public Member Functions

 bounded_allocation (size_t *existing_buffer, size_t size_in_words)
 Uses an existing buffer to hold the parsed AST, if it fits. More...
 
template<size_t N>
 bounded_allocation (size_t(&existing_buffer)[N])
 Convenience wrapper for bounded_allocation(size_t*, size) that automatically infers the size of the given array. More...
 

Detailed Description

Allocation policy that attempts to fit the parsed AST into an existing memory buffer.

This allocation policy is useful when using sajson in a zero-allocation context or when there are constraints on the amount

Constructor & Destructor Documentation

sajson::bounded_allocation::bounded_allocation ( size_t *  existing_buffer,
size_t  size_in_words 
)
inline

Uses an existing buffer to hold the parsed AST, if it fits.

The specified buffer must not be deallocated until after the document is parsed and the AST traversed.

template<size_t N>
sajson::bounded_allocation::bounded_allocation ( size_t(&)  existing_buffer[N])
inlineexplicit

Convenience wrapper for bounded_allocation(size_t*, size) that automatically infers the size of the given array.


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