sajson
High-Performance JSON Parser
|
Allocation policy that allocates one large buffer guaranteed to hold the resulting AST. More...
#include <sajson.h>
Public Member Functions | |
single_allocation () | |
Allocate a single worst-case AST buffer with one word per byte in the input document. More... | |
single_allocation (size_t *existing_buffer, size_t size_in_words) | |
Write the AST into an existing buffer. More... | |
template<size_t N> | |
single_allocation (size_t(&existing_buffer)[N]) | |
Convenience wrapper for single_allocation(size_t*, size_t) that automatically infers the length of a given array. More... | |
Allocation policy that allocates one large buffer guaranteed to hold the resulting AST.
This allocation policy is the fastest since it requires no conditionals to see if more memory must be allocated.
|
inline |
Allocate a single worst-case AST buffer with one word per byte in the input document.
|
inline |
Write the AST into an existing buffer.
Will fail with an out of memory error if the buffer is not guaranteed to be big enough for the document. The caller must guarantee the memory is valid for the duration of the parse and the AST traversal.
|
inlineexplicit |
Convenience wrapper for single_allocation(size_t*, size_t) that automatically infers the length of a given array.