TachyonUI
0.1.0
High-performance UI for building tools.
Toggle main menu visibility
Loading...
Searching...
No Matches
gui_allocation_hooks.h
Go to the documentation of this file.
1
#pragma once
2
3
#include <cstddef>
4
5
namespace
tachyon
6
{
9
14
struct
AllocationHooks
15
{
17
void
* (*allocate)(
size_t
size,
size_t
alignment,
void
*
user
) =
nullptr
;
20
void
* (*reallocate)(
void
* ptr,
size_t
size,
size_t
alignment,
void
*
user
) =
nullptr
;
22
void (*
free
)(
void
* ptr,
void
*
user
) =
nullptr
;
23
void
*
user
=
nullptr
;
24
26
bool
IsSet
()
const
{
return
allocate
&&
reallocate
&&
free
; }
27
};
28
29
}
tachyon
Definition
gui_logging.h:24
tachyon::AllocationHooks
Memory functions a host gives the library, for the allocations that can be routed: Vulkan objects,...
Definition
gui_allocation_hooks.h:15
tachyon::AllocationHooks::free
void(*) free(void *ptr, void *user)
Frees ptr, which may be null.
Definition
gui_allocation_hooks.h:22
tachyon::AllocationHooks::user
void * user
passed to every call
Definition
gui_allocation_hooks.h:23
tachyon::AllocationHooks::allocate
void *(*) allocate(size_t size, size_t alignment, void *user)
Returns size bytes aligned to alignment (a power of two).
Definition
gui_allocation_hooks.h:17
tachyon::AllocationHooks::reallocate
void *(*) reallocate(void *ptr, size_t size, size_t alignment, void *user)
Resizes ptr, keeping its alignment; ptr may be null (then it allocates).
Definition
gui_allocation_hooks.h:20
tachyon::AllocationHooks::IsSet
bool IsSet() const
The hooks are used only when all three functions are set.
Definition
gui_allocation_hooks.h:26
gui_core
memory
gui_allocation_hooks.h
Generated by
1.18.0