|
TachyonUI 0.1.0
High-performance UI for building tools.
|
Memory functions a host gives the library, for the allocations that can be routed: Vulkan objects, VMA, vk-bootstrap and SDL. More...
#include <gui_core/memory/gui_allocation_hooks.h>
Public Member Functions | |
| bool | IsSet () const |
| The hooks are used only when all three functions are set. | |
Public Attributes | |
| void *(*) | allocate (size_t size, size_t alignment, void *user) = nullptr |
| Returns size bytes aligned to alignment (a power of two). | |
| void *(*) | reallocate (void *ptr, size_t size, size_t alignment, void *user) = nullptr |
| Resizes ptr, keeping its alignment; ptr may be null (then it allocates). | |
| void(*) | free (void *ptr, void *user) = nullptr |
| Frees ptr, which may be null. | |
| void * | user = nullptr |
| passed to every call | |
Memory functions a host gives the library, for the allocations that can be routed: Vulkan objects, VMA, vk-bootstrap and SDL.
They must be thread-safe (drivers call them from their own threads) and stay valid for the rest of the process: SDL can keep a few allocations past SDL_Quit (logged) and keeps using the hooks.
|
inline |
The hooks are used only when all three functions are set.
| void *(*) tachyon::AllocationHooks::allocate(size_t size, size_t alignment, void *user) = nullptr |
Returns size bytes aligned to alignment (a power of two).
| void *(*) tachyon::AllocationHooks::reallocate(void *ptr, size_t size, size_t alignment, void *user) = nullptr |
Resizes ptr, keeping its alignment; ptr may be null (then it allocates).
size is never 0.
| void(*) tachyon::AllocationHooks::free(void *ptr, void *user) = nullptr |
Frees ptr, which may be null.
| void* tachyon::AllocationHooks::user = nullptr |
passed to every call