|
rapidyaml
0.8.0
parse and emit YAML, and do it fast
|
an example for a per-tree memory allocator More...
Public Member Functions | |
| ryml::Callbacks | callbacks () const |
| void * | allocate (size_t len) |
| void | free (void *mem, size_t len) |
| ~PerTreeMemoryExample () | |
| void | check_and_reset () |
Public Attributes | |
| std::vector< char > | memory_pool = std::vector<char>(10u * 1024u) |
| size_t | num_allocs = 0 |
| size_t | alloc_size = 0 |
| size_t | num_deallocs = 0 |
| size_t | dealloc_size = 0 |
an example for a per-tree memory allocator
Definition at line 4891 of file quickstart.cpp.
|
inline |
|
inline |
Definition at line 4897 of file quickstart.cpp.
References allocate(), free(), c4::yml::Callbacks::m_allocate, c4::yml::Callbacks::m_free, and c4::yml::Callbacks::m_user_data.
Referenced by sample::sample_per_tree_allocator().
|
inline |
Definition at line 4910 of file quickstart.cpp.
References alloc_size, memory_pool, and num_allocs.
Referenced by callbacks().
|
inline |
Definition at line 4923 of file quickstart.cpp.
References CHECK, dealloc_size, memory_pool, and num_deallocs.
Referenced by callbacks().
|
inline |
Definition at line 4937 of file quickstart.cpp.
References alloc_size, CHECK, dealloc_size, num_allocs, and num_deallocs.
Referenced by ~PerTreeMemoryExample().
| std::vector<char> sample::PerTreeMemoryExample::memory_pool = std::vector<char>(10u * 1024u) |
Definition at line 4893 of file quickstart.cpp.
Referenced by allocate(), and free().
| size_t sample::PerTreeMemoryExample::num_allocs = 0 |
Definition at line 4894 of file quickstart.cpp.
Referenced by allocate(), check_and_reset(), and sample::sample_per_tree_allocator().
| size_t sample::PerTreeMemoryExample::alloc_size = 0 |
Definition at line 4894 of file quickstart.cpp.
Referenced by allocate(), check_and_reset(), and sample::sample_per_tree_allocator().
| size_t sample::PerTreeMemoryExample::num_deallocs = 0 |
Definition at line 4895 of file quickstart.cpp.
Referenced by check_and_reset(), and free().
| size_t sample::PerTreeMemoryExample::dealloc_size = 0 |
Definition at line 4895 of file quickstart.cpp.
Referenced by check_and_reset(), and free().