TachyonUI
1.1.0
High-performance UI for building tools.
Toggle main menu visibility
Loading...
Searching...
No Matches
gui_library_allocator.h
Go to the documentation of this file.
1
#pragma once
2
3
#include <
gui_core/memory/gui_allocation_hooks.h
>
4
5
#include <cstddef>
6
7
// The memory functions HarfBuzz, skribidi, SheenBidi and nanosvg are built to call in place
8
// of malloc, calloc, realloc and free. Each block remembers what made it (the C heap or a set
9
// of hooks), so it is always freed by that, whatever is routed by then.
10
extern
"C"
11
{
12
void
*
tachyon_library_malloc
(
size_t
size);
13
void
*
tachyon_library_calloc
(
size_t
count,
size_t
size);
14
void
*
tachyon_library_realloc
(
void
* ptr,
size_t
size);
15
void
tachyon_library_free
(
void
* ptr);
16
}
17
18
namespace
tachyon
19
{
22
25
namespace
LibraryAllocator
26
{
28
using
RouteHandle
=
const
void
*;
29
32
RouteHandle
Route
(
const
AllocationHooks
& hooks);
33
36
void
Unroute
(
RouteHandle
route);
37
39
bool
IsRouted
();
40
44
class
HeapScope
45
{
46
public
:
47
HeapScope
();
48
~HeapScope
();
49
HeapScope
(
const
HeapScope
&) =
delete
;
50
HeapScope
&
operator=
(
const
HeapScope
&) =
delete
;
51
};
52
}
53
54
}
tachyon::LibraryAllocator::HeapScope::HeapScope
HeapScope(const HeapScope &)=delete
tachyon::LibraryAllocator::HeapScope::operator=
HeapScope & operator=(const HeapScope &)=delete
tachyon::LibraryAllocator::HeapScope::~HeapScope
~HeapScope()
tachyon::LibraryAllocator::HeapScope::HeapScope
HeapScope()
gui_allocation_hooks.h
tachyon_library_calloc
void * tachyon_library_calloc(size_t count, size_t size)
tachyon_library_realloc
void * tachyon_library_realloc(void *ptr, size_t size)
tachyon_library_malloc
void * tachyon_library_malloc(size_t size)
tachyon_library_free
void tachyon_library_free(void *ptr)
tachyon::LibraryAllocator
Where the text and SVG libraries (HarfBuzz, skribidi, SheenBidi, nanosvg) get their memory: the C hea...
Definition
gui_library_allocator.h:26
tachyon::LibraryAllocator::Unroute
void Unroute(RouteHandle route)
Back to the C heap, if route is still the one in place.
tachyon::LibraryAllocator::RouteHandle
const void * RouteHandle
A route, as Route returns it; null when nothing was routed.
Definition
gui_library_allocator.h:28
tachyon::LibraryAllocator::IsRouted
bool IsRouted()
Whether the libraries allocate through hooks right now.
tachyon::LibraryAllocator::Route
RouteHandle Route(const AllocationHooks &hooks)
From now on the libraries allocate through hooks.
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:17
gui_core
memory
gui_library_allocator.h
Generated by
1.18.0