Public Member Functions | Private Attributes | List of all members
sajson::bounded_allocation Class Reference

#include <sajson.h>

Public Member Functions

 bounded_allocation (size_t *existing_buffer_, size_t size_in_words)
 
template<size_t N>
 bounded_allocation (size_t(&existing_buffer_)[N])
 

Private Attributes

size_t * existing_buffer
 
size_t existing_buffer_size
 

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

Definition at line 1346 of file sajson.h.

Constructor & Destructor Documentation

◆ bounded_allocation() [1/2]

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.

Definition at line 1490 of file sajson.h.

◆ bounded_allocation() [2/2]

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.

Definition at line 1498 of file sajson.h.

Member Data Documentation

◆ existing_buffer

size_t* sajson::bounded_allocation::existing_buffer
private

Definition at line 1512 of file sajson.h.

◆ existing_buffer_size

size_t sajson::bounded_allocation::existing_buffer_size
private

Definition at line 1513 of file sajson.h.


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


mvsim
Author(s):
autogenerated on Tue Jul 4 2023 03:08:23