|
| static void * | s_allocate (size_t len, void *, void *this_) |
| |
| static void | s_free (void *mem, size_t len, void *this_) |
| |
Definition at line 5880 of file quickstart.cpp.
◆ ~GlobalAllocatorExample()
| GlobalAllocatorExample::~GlobalAllocatorExample |
( |
| ) |
|
|
inline |
◆ allocate()
| void* GlobalAllocatorExample::allocate |
( |
size_t |
len | ) |
|
|
inline |
Definition at line 5886 of file quickstart.cpp.
5892 uintptr_t uptr = (uintptr_t)ptr;
5893 const uintptr_t align =
alignof(max_align_t);
5896 uintptr_t prev = uptr - (uptr % align);
5897 uintptr_t next = prev + align;
5898 uintptr_t corr = next - uptr;
5899 ptr = (
void*)(((
char*)ptr) + corr);
5903 "out of memory! requested=%zu+%zu available=%zu\n",
std::vector< char > memory_pool
◆ free()
| void GlobalAllocatorExample::free |
( |
void * |
mem, |
|
|
size_t |
len |
|
) |
| |
|
inline |
Definition at line 5908 of file quickstart.cpp.
#define CHECK(predicate)
a quick'n'dirty assertion to verify a predicate
◆ callbacks()
Definition at line 5918 of file quickstart.cpp.
static void s_free(void *mem, size_t len, void *this_)
static void * s_allocate(size_t len, void *, void *this_)
A c-style callbacks class to customize behavior on errors or allocation.
Callbacks & set_free(pfn_free free=nullptr)
Set or reset the free callback.
Callbacks & set_allocate(pfn_allocate allocate=nullptr)
Set or reset the allocate callback.
Callbacks & set_user_data(void *user_data)
Set the user data.
◆ s_allocate()
| static void* GlobalAllocatorExample::s_allocate |
( |
size_t |
len, |
|
|
void * |
, |
|
|
void * |
this_ |
|
) |
| |
|
inlinestatic |
◆ s_free()
| static void GlobalAllocatorExample::s_free |
( |
void * |
mem, |
|
|
size_t |
len, |
|
|
void * |
this_ |
|
) |
| |
|
inlinestatic |
◆ check_and_reset()
| void GlobalAllocatorExample::check_and_reset |
( |
| ) |
|
|
inline |
◆ memory_pool
| std::vector<char> GlobalAllocatorExample::memory_pool = std::vector<char>(10u * 1024u) |
◆ num_allocs
| size_t GlobalAllocatorExample::num_allocs = 0 |
◆ alloc_size
| size_t GlobalAllocatorExample::alloc_size = 0 |
◆ corr_size
| size_t GlobalAllocatorExample::corr_size = 0 |
◆ num_deallocs
| size_t GlobalAllocatorExample::num_deallocs = 0 |
◆ dealloc_size
| size_t GlobalAllocatorExample::dealloc_size = 0 |
The documentation for this struct was generated from the following file:
- /home/docs/checkouts/readthedocs.org/user_builds/rapidyaml/checkouts/v0.13.0/samples/quickstart.cpp