Ultibo API
C/C++ API for Ultibo Core
Loading...
Searching...
No Matches
heapmanager.h
Go to the documentation of this file.
1/*
2 * This file is part of the Ultibo project, https://ultibo.org/
3 *
4 * The MIT License (MIT)
5 *
6 * Copyright (c) 2026 Garry Wood <garry@softoz.com.au>
7 *
8 * Permission is hereby granted, free of charge, to any person obtaining a copy
9 * of this software and associated documentation files (the "Software"), to deal
10 * in the Software without restriction, including without limitation the rights
11 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
12 * copies of the Software, and to permit persons to whom the Software is
13 * furnished to do so, subject to the following conditions:
14 *
15 * The above copyright notice and this permission notice shall be included in
16 * all copies or substantial portions of the Software.
17 *
18 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
19 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
20 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
21 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
22 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
23 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
24 * THE SOFTWARE.
25 */
26#ifndef _ULTIBO_HEAPMANAGER_H
27#define _ULTIBO_HEAPMANAGER_H
28
34
35#ifdef __cplusplus
36extern "C" {
37#endif
38
39#include "ultibo/globaltypes.h"
40#include "ultibo/globalconst.h"
41#include "ultibo/system.h"
42
44#if defined (__x86_64__) || defined (__arch64__)
45#define HEAP_MIN_BLOCK 57
46#else
47#define HEAP_MIN_BLOCK 33
48#endif
49#define HEAP_MIN_ALIGN 64
50
52#define HEAP_SIGNATURE 0xE84DF600
53#define HEAP_SIGNATURE_MASK 0xFFFFFF00
54
56#define HEAP_STATE_FREE 0
57#define HEAP_STATE_USED 1
58
59#define HEAP_STATE_MASK 0x000000FF
60#define HEAP_STATE_ALL 2
61
63#define HEAP_FLAG_NORMAL 0x00000000
64#define HEAP_FLAG_SHARED 0x00000001
65#define HEAP_FLAG_LOCAL 0x00000002
66#define HEAP_FLAG_CODE 0x00000004
67#define HEAP_FLAG_DEVICE 0x00000008
68#define HEAP_FLAG_NOCACHE 0x00000010
69#define HEAP_FLAG_NONSHARED 0x00000020
70#define HEAP_FLAG_LOCKED 0x00000040
71#define HEAP_FLAG_IRQ 0x00000080
72#define HEAP_FLAG_FIQ 0x00000100
73#define HEAP_FLAG_RECLAIM 0x00000200
74
75#define HEAP_FLAG_CUSTOM 0x08000000
76
77#define HEAP_FLAG_ALL 0xFFFFFFFF
78#define HEAP_FLAG_INVALID 0xFFFFFFFF
79
81#if defined (__x86_64__) || defined (__arch64__)
82#define HEAP_SMALL_MIN 56
83#else
84#define HEAP_SMALL_MIN 32
85#endif
86#define HEAP_SMALL_MAX SIZE_4K
87#define HEAP_SMALL_ALIGN 4
88#define HEAP_SMALL_SHIFT 2
89
90#define HEAP_SMALL_LOW (HEAP_SMALL_MIN / HEAP_SMALL_ALIGN)
91#define HEAP_SMALL_HIGH (HEAP_SMALL_MAX / HEAP_SMALL_ALIGN)
92
94#ifdef HEAP_STATISTICS_ENABLED
95typedef struct _HEAP_STATISTICS HEAP_STATISTICS;
96struct _HEAP_STATISTICS
97{
98 // Get/Alloc/Realloc
99 uint32_t getcount;
100 uint32_t alloccount;
101 uint32_t realloccount;
102 uint32_t getalignedcount;
103 uint32_t allocalignedcount;
104 uint32_t reallocalignedcount;
105 uint32_t getsharedcount;
106 uint32_t allocsharedcount;
107 uint32_t reallocsharedcount;
108 uint32_t getlocalcount;
109 uint32_t alloclocalcount;
110 uint32_t realloclocalcount;
111 uint32_t getcodecount;
112 uint32_t alloccodecount;
113 uint32_t realloccodecount;
114 uint32_t getdevicecount;
115 uint32_t allocdevicecount;
116 uint32_t reallocdevicecount;
117 uint32_t getnocachecount;
118 uint32_t allocnocachecount;
119 uint32_t reallocnocachecount;
120 uint32_t getnonsharedcount;
121 uint32_t allocnonsharedcount;
122 uint32_t reallocnonsharedcount;
123 uint32_t getirqcount;
124 uint32_t allocirqcount;
125 uint32_t reallocirqcount;
126 uint32_t getfiqcount;
127 uint32_t allocfiqcount;
128 uint32_t reallocfiqcount;
129 // Free
130 uint32_t freecount;
131 uint32_t freeirqcount;
132 uint32_t freefiqcount;
133 uint32_t freesizecount;
134 // Size
135 uint32_t sizecount;
136 uint32_t sizeirqcount;
137 uint32_t sizefiqcount;
138 // Flags
139 uint32_t flagscount;
140 uint32_t flagsirqcount;
141 uint32_t flagsfiqcount;
142 // Register
143 uint32_t registercount;
144 // Reserve
145 uint32_t reservecount;
146 // Request
147 uint32_t requestcount;
148 uint32_t requestsharedcount;
149 uint32_t requestlocalcount;
150 uint32_t requestcodecount;
151 uint32_t requestdevicecount;
152 uint32_t requestnocachecount;
153 uint32_t requestnonsharedcount;
154 uint32_t requestirqcount;
155 uint32_t requestfiqcount;
156 // Get Internal
157 uint32_t getzerocount;
158 uint32_t getremaincount;
159 uint32_t getinvalidcount;
160 uint32_t getunavailablecount;
161 uint32_t getaddfailcount;
162 uint32_t getsplitfailcount;
163 uint32_t getremovefailcount;
164 // Realloc Internal
165 uint32_t realloczerocount;
166 uint32_t reallocsmallercount;
167 uint32_t realloclargercount;
168 uint32_t reallocreleasecount;
169 uint32_t reallocreleasebytes;
170 uint32_t reallocaddfailcount;
171 uint32_t reallocsplitfailcount;
172 uint32_t reallocremovefailcount;
173 // GetAligned Internal
174 uint32_t getalignedzerocount;
175 uint32_t getalignedremaincount;
176 uint32_t getalignedinvalidcount;
177 uint32_t getalignedundersizecount;
178 uint32_t getalignedunavailablecount;
179 uint32_t getalignedaddfailcount;
180 uint32_t getalignedsplitfailcount;
181 uint32_t getalignedremovefailcount;
182 uint32_t getalignedreleasecount;
183 uint32_t getalignedreleasebytes;
184 // Free Internal
185 uint32_t freeinvalidcount;
186 uint32_t freeaddfailcount;
187 uint32_t freemergefailcount;
188 uint32_t freeremovefailcount;
189 // Size Internal
190 uint32_t sizeinvalidcount;
191 // Flags Internal
192 uint32_t flagsinvalidcount;
193 // Register Internal
194 uint32_t registerinvalidcount;
195 uint32_t registeraddfailcount;
196 // Reserve Internal
197 uint32_t reserveinvalidcount;
198 uint32_t reserveaddfailcount;
199 uint32_t reservesplitfailcount;
200 uint32_t reserveremovefailcount;
201 uint32_t reserveunavailablecount;
202 // Request Internal
203 uint32_t requestinvalidcount;
204 uint32_t requestaddfailcount;
205 uint32_t requestsplitfailcount;
206 uint32_t requestremovefailcount;
207 uint32_t requestunavailablecount;
208 // Split Internal
209 uint32_t splitcount;
210 // Merge Internal
211 uint32_t mergeprevcount;
212 uint32_t mergenextcount;
213 // Block Internal
214 uint32_t getsmallcount;
215 uint32_t getlargecount;
216 uint32_t findfreecount;
217 uint32_t addsmallcount;
218 uint32_t addlargecount;
219 uint32_t removesmallcount;
220 uint32_t removelargecount;
221 uint32_t smallunavailablecount;
222};
223#endif
224
227{
228 // Snapshot Properties
229 size_t address;
230 size_t size;
231 uint32_t state;
232 uint32_t flags;
233 uint32_t affinity;
234 // Internal Properties
236};
237
239
243void * STDCALL get_mem(size_t size);
244
248void * STDCALL get_mem_ex(size_t size, uint32_t flags, uint32_t affinity);
249
254void * STDCALL get_aligned_mem(size_t size, size_t alignment);
255
261void * STDCALL get_aligned_mem_ex(size_t size, size_t alignment, uint32_t flags, uint32_t affinity);
262
266void * STDCALL get_shared_mem(size_t size);
267
272void * STDCALL get_shared_aligned_mem(size_t size, size_t alignment);
273
277void * STDCALL get_local_mem(size_t size, uint32_t affinity);
278
283void * STDCALL get_local_aligned_mem(size_t size, size_t alignment, uint32_t affinity);
284
288void * STDCALL get_code_mem(size_t size, uint32_t affinity);
289
294void * STDCALL get_code_aligned_mem(size_t size, size_t alignment, uint32_t affinity);
295
299void * STDCALL get_device_mem(size_t size);
300
305void * STDCALL get_device_aligned_mem(size_t size, size_t alignment);
306
310void * STDCALL get_nocache_mem(size_t size);
311
316void * STDCALL get_nocache_aligned_mem(size_t size, size_t alignment);
317
321void * STDCALL get_nonshared_mem(size_t size);
322
327void * STDCALL get_nonshared_aligned_mem(size_t size, size_t alignment);
328
333void * STDCALL get_irq_mem(size_t size, uint32_t affinity);
334
340void * STDCALL get_irq_aligned_mem(size_t size, size_t alignment, uint32_t affinity);
341
346void * STDCALL get_fiq_mem(size_t size, uint32_t affinity);
347
353void * STDCALL get_fiq_aligned_mem(size_t size, size_t alignment, uint32_t affinity);
354
358size_t STDCALL free_mem(void *addr);
359
363size_t STDCALL free_irq_mem(void *addr);
364
368size_t STDCALL free_fiq_mem(void *addr);
369
374void * STDCALL alloc_mem(size_t size);
375
379void * STDCALL alloc_mem_ex(size_t size, uint32_t flags, uint32_t affinity);
380
384void * STDCALL realloc_mem(void *addr, size_t size);
385
389void * STDCALL realloc_mem_ex(void *addr, size_t size, uint32_t flags, uint32_t affinity);
390
395void * STDCALL alloc_aligned_mem(size_t size, size_t alignment);
396
402void * STDCALL alloc_aligned_mem_ex(size_t size, size_t alignment, uint32_t flags, uint32_t affinity);
403
408void * STDCALL realloc_aligned_mem(void *addr, size_t size, size_t alignment);
409
415void * STDCALL realloc_aligned_mem_ex(void *addr, size_t size, size_t alignment, uint32_t flags, uint32_t affinity);
416
420void * STDCALL alloc_shared_mem(size_t size);
421
426void * STDCALL alloc_shared_aligned_mem(size_t size, size_t alignment);
427
431void * STDCALL realloc_shared_mem(void *addr, size_t size);
432
437void * STDCALL realloc_shared_aligned_mem(void *addr, size_t size, size_t alignment);
438
442void * STDCALL alloc_local_mem(size_t size, uint32_t affinity);
443
448void * STDCALL alloc_local_aligned_mem(size_t size, size_t alignment, uint32_t affinity);
449
453void * STDCALL realloc_local_mem(void *addr, size_t size, uint32_t affinity);
454
459void * STDCALL realloc_local_aligned_mem(void *addr, size_t size, size_t alignment, uint32_t affinity);
460
464void * STDCALL alloc_code_mem(size_t size, uint32_t affinity);
465
470void * STDCALL alloc_code_aligned_mem(size_t size, size_t alignment, uint32_t affinity);
471
475void * STDCALL realloc_code_mem(void *addr, size_t size, uint32_t affinity);
476
481void * STDCALL realloc_code_aligned_mem(void *addr, size_t size, size_t alignment, uint32_t affinity);
482
486void * STDCALL alloc_device_mem(size_t size);
487
492void * STDCALL alloc_device_aligned_mem(size_t size, size_t alignment);
493
497void * STDCALL realloc_device_mem(void *addr, size_t size);
498
503void * STDCALL realloc_device_aligned_mem(void *addr, size_t size, size_t alignment);
504
508void * STDCALL alloc_nocache_mem(size_t size);
509
514void * STDCALL alloc_nocache_aligned_mem(size_t size, size_t alignment);
515
519void * STDCALL realloc_nocache_mem(void *addr, size_t size);
520
525void * STDCALL realloc_nocache_aligned_mem(void *addr, size_t size, size_t alignment);
526
530void * STDCALL alloc_nonshared_mem(size_t size);
531
536void * STDCALL alloc_nonshared_aligned_mem(size_t size, size_t alignment);
537
541void * STDCALL realloc_nonshared_mem(void *addr, size_t size);
542
547void * STDCALL realloc_nonshared_aligned_mem(void *addr, size_t size, size_t alignment);
548
553void * STDCALL alloc_irq_mem(size_t size, uint32_t affinity);
554
560void * STDCALL alloc_irq_aligned_mem(size_t size, size_t alignment, uint32_t affinity);
561
566void * STDCALL realloc_irq_mem(void *addr, size_t size, uint32_t affinity);
567
573void * STDCALL realloc_irq_aligned_mem(void *addr, size_t size, size_t alignment, uint32_t affinity);
574
579void * STDCALL alloc_fiq_mem(size_t size, uint32_t affinity);
580
586void * STDCALL alloc_fiq_aligned_mem(size_t size, size_t alignment, uint32_t affinity);
587
592void * STDCALL realloc_fiq_mem(void *addr, size_t size, uint32_t affinity);
593
599void * STDCALL realloc_fiq_aligned_mem(void *addr, size_t size, size_t alignment, uint32_t affinity);
600
604size_t STDCALL size_mem(void *addr);
605
609size_t STDCALL size_irq_mem(void *addr);
610
614size_t STDCALL size_fiq_mem(void *addr);
615
619uint32_t STDCALL mem_flags(void *addr);
620
624uint32_t STDCALL mem_flags_irq(void *addr);
625
629uint32_t STDCALL mem_flags_fiq(void *addr);
630
635
640
641#ifdef HEAP_STATISTICS_ENABLED
645HEAP_STATISTICS STDCALL get_heap_statistics(void);
646#endif
647
651uint32_t STDCALL get_heap_block_count(uint32_t state);
652
657uint32_t STDCALL get_heap_block_count_ex(uint32_t state, uint32_t flags, uint32_t affinity);
658
662uint32_t STDCALL get_heap_block_min(uint32_t state);
663
668uint32_t STDCALL get_heap_block_min_ex(uint32_t state, uint32_t flags, uint32_t affinity);
669
673uint32_t STDCALL get_heap_block_max(uint32_t state);
674
679uint32_t STDCALL get_heap_block_max_ex(uint32_t state, uint32_t flags, uint32_t affinity);
680
682HEAP_SNAPSHOT * STDCALL create_heap_snapshot_ex(uint32_t state, uint32_t flags, uint32_t affinity);
684
685#ifdef __cplusplus
686}
687#endif
688
689#endif // _ULTIBO_HEAPMANAGER_H
#define STDCALL
Definition globaltypes.h:45
void *STDCALL get_irq_aligned_mem(size_t size, size_t alignment, uint32_t affinity)
Allocate a block of IRQ memory aligned on a multiple of the alignment value.
uint32_t STDCALL get_heap_block_min_ex(uint32_t state, uint32_t flags, uint32_t affinity)
Get the minimum size of current heap blocks based on state, flags and affinity.
void *STDCALL realloc_nonshared_aligned_mem(void *addr, size_t size, size_t alignment)
Reallocate a block of non shared memory aligned on a multiple of the alignment value.
void *STDCALL get_nonshared_mem(size_t size)
Allocate a block of non shared memory.
void *STDCALL realloc_mem(void *addr, size_t size)
Reallocate a block of normal memory.
struct _HEAP_SNAPSHOT HEAP_SNAPSHOT
Definition heapmanager.h:225
void *STDCALL alloc_nocache_mem(size_t size)
Allocate and clear a block of non cached memory.
void *STDCALL get_fiq_mem(size_t size, uint32_t affinity)
Allocate a block of FIQ memory.
size_t STDCALL size_mem(void *addr)
Return the size of an allocated block of memory.
uint32_t STDCALL get_heap_block_min(uint32_t state)
Get the minimum size of current heap blocks based on state.
void *STDCALL alloc_nocache_aligned_mem(size_t size, size_t alignment)
Allocate and clear a block of non cached memory aligned on a multiple of the alignment value.
void *STDCALL alloc_device_mem(size_t size)
Allocate and clear a block of device memory.
void *STDCALL alloc_device_aligned_mem(size_t size, size_t alignment)
Allocate and clear a block of device memory aligned on a multiple of the alignment value.
void *STDCALL realloc_irq_aligned_mem(void *addr, size_t size, size_t alignment, uint32_t affinity)
Reallocate a block of IRQ memory aligned on a multiple of the alignment value.
void *STDCALL get_mem(size_t size)
Allocate a block of normal memory.
void *STDCALL realloc_local_mem(void *addr, size_t size, uint32_t affinity)
Reallocate a block of local memory.
void *STDCALL realloc_nocache_aligned_mem(void *addr, size_t size, size_t alignment)
Reallocate a block of non cached memory aligned on a multiple of the alignment value.
void *STDCALL alloc_irq_mem(size_t size, uint32_t affinity)
Allocate and clear a block of IRQ memory.
void *STDCALL get_local_mem(size_t size, uint32_t affinity)
Allocate a block of local memory.
void *STDCALL alloc_mem_ex(size_t size, uint32_t flags, uint32_t affinity)
Allocate and clear a block of memory with the flags and affinity requested.
void *STDCALL get_code_aligned_mem(size_t size, size_t alignment, uint32_t affinity)
Allocate a block of code memory aligned on a multiple of the alignment value.
HEAP_SNAPSHOT *STDCALL create_heap_snapshot_ex(uint32_t state, uint32_t flags, uint32_t affinity)
void *STDCALL alloc_aligned_mem_ex(size_t size, size_t alignment, uint32_t flags, uint32_t affinity)
Allocate and clear a block of normal memory aligned on a multiple of the alignment value with the fla...
void *STDCALL realloc_shared_mem(void *addr, size_t size)
Reallocate a block of shared memory.
void *STDCALL realloc_nocache_mem(void *addr, size_t size)
Reallocate a block of non cached memory.
void *STDCALL get_mem_ex(size_t size, uint32_t flags, uint32_t affinity)
Allocate a block of memory with the flags and affinity requested.
void *STDCALL get_fiq_aligned_mem(size_t size, size_t alignment, uint32_t affinity)
Allocate a block of FIQ memory aligned on a multiple of the alignment value.
uint32_t STDCALL mem_flags(void *addr)
Return the flags of an allocated block of memory.
HEAP_STATUS STDCALL get_heap_status(void)
Return status information for the heap manager.
uint32_t STDCALL destroy_heap_snapshot(HEAP_SNAPSHOT *snapshot)
void *STDCALL alloc_irq_aligned_mem(size_t size, size_t alignment, uint32_t affinity)
Allocate and clear a block of IRQ memory aligned on a multiple of the alignment value.
void *STDCALL get_code_mem(size_t size, uint32_t affinity)
Allocate a block of code memory.
void *STDCALL realloc_device_mem(void *addr, size_t size)
Reallocate a block of device memory.
void *STDCALL realloc_mem_ex(void *addr, size_t size, uint32_t flags, uint32_t affinity)
Reallocate a block of memory with the flags and affinity requested.
void *STDCALL realloc_fiq_aligned_mem(void *addr, size_t size, size_t alignment, uint32_t affinity)
Reallocate a block of FIQ memory aligned on a multiple of the alignment value.
uint32_t STDCALL get_heap_block_count_ex(uint32_t state, uint32_t flags, uint32_t affinity)
Get the number of current heap blocks based on state, flags and affinity.
void *STDCALL get_nocache_aligned_mem(size_t size, size_t alignment)
Allocate a block of non cached memory aligned on a multiple of the alignment value.
void *STDCALL get_local_aligned_mem(size_t size, size_t alignment, uint32_t affinity)
Allocate a block of local memory aligned on a multiple of the alignment value.
size_t STDCALL size_irq_mem(void *addr)
Return the size of an allocated block of IRQ memory.
uint32_t STDCALL get_heap_block_count(uint32_t state)
Get the total number of current heap blocks based on state.
void *STDCALL get_aligned_mem_ex(size_t size, size_t alignment, uint32_t flags, uint32_t affinity)
Allocate a block of memory aligned on a multiple of the alignment value with the flags and affinity r...
void *STDCALL realloc_fiq_mem(void *addr, size_t size, uint32_t affinity)
Reallocate a block of FIQ memory.
void *STDCALL alloc_code_aligned_mem(size_t size, size_t alignment, uint32_t affinity)
Allocate and clear a block of code memory aligned on a multiple of the alignment value.
void *STDCALL alloc_nonshared_mem(size_t size)
Allocate and clear a block of non shared memory.
void *STDCALL get_device_mem(size_t size)
Allocate a block of device memory.
void *STDCALL realloc_local_aligned_mem(void *addr, size_t size, size_t alignment, uint32_t affinity)
Reallocate a block of local memory aligned on a multiple of the alignment value.
void *STDCALL get_aligned_mem(size_t size, size_t alignment)
Allocate a block of normal memory aligned on a multiple of the alignment value.
void *STDCALL alloc_nonshared_aligned_mem(size_t size, size_t alignment)
Allocate and clear a block of non shared memory aligned on a multiple of the alignment value.
uint32_t STDCALL mem_flags_fiq(void *addr)
Return the flags of an allocated block of FIQ memory.
void *STDCALL get_nonshared_aligned_mem(size_t size, size_t alignment)
Allocate a block of non shared memory aligned on a multiple of the alignment value.
void *STDCALL alloc_aligned_mem(size_t size, size_t alignment)
Allocate and clear a block of normal memory aligned on a multiple of the alignment value.
void *STDCALL alloc_shared_aligned_mem(size_t size, size_t alignment)
Allocate and clear a block of shared memory aligned on a multiple of the alignment value.
void *STDCALL get_device_aligned_mem(size_t size, size_t alignment)
Allocate a block of device memory aligned on a multiple of the alignment value.
void *STDCALL get_irq_mem(size_t size, uint32_t affinity)
Allocate a block of IRQ memory.
void *STDCALL get_shared_aligned_mem(size_t size, size_t alignment)
Allocate a block of shared memory aligned on a multiple of the alignment value.
void *STDCALL alloc_shared_mem(size_t size)
Allocate and clear a block of shared memory.
size_t STDCALL free_mem(void *addr)
Free a block of memory.
void *STDCALL realloc_code_mem(void *addr, size_t size, uint32_t affinity)
Reallocate a block of code memory.
void *STDCALL realloc_nonshared_mem(void *addr, size_t size)
Reallocate a block of non shared memory.
size_t STDCALL free_fiq_mem(void *addr)
Free a block of FIQ memory.
void *STDCALL alloc_fiq_aligned_mem(size_t size, size_t alignment, uint32_t affinity)
Allocate and clear a block of FIQ memory aligned on a multiple of the alignment value.
void *STDCALL alloc_local_mem(size_t size, uint32_t affinity)
Allocate and clear a block of local memory.
void *STDCALL realloc_aligned_mem(void *addr, size_t size, size_t alignment)
Reallocate a block of normal memory aligned on a multiple of the alignment value.
void *STDCALL realloc_code_aligned_mem(void *addr, size_t size, size_t alignment, uint32_t affinity)
Reallocate a block of code memory aligned on a multiple of the alignment value.
uint32_t STDCALL get_heap_block_max(uint32_t state)
Get the maximum size of current heap blocks based on state.
void *STDCALL alloc_mem(size_t size)
Allocate and clear a block of normal memory.
void *STDCALL alloc_fiq_mem(size_t size, uint32_t affinity)
Allocate and clear a block of FIQ memory.
size_t STDCALL free_irq_mem(void *addr)
Free a block of IRQ memory.
void *STDCALL get_shared_mem(size_t size)
Allocate a block of shared memory.
void *STDCALL realloc_device_aligned_mem(void *addr, size_t size, size_t alignment)
Reallocate a block of device memory aligned on a multiple of the alignment value.
void *STDCALL realloc_irq_mem(void *addr, size_t size, uint32_t affinity)
Reallocate a block of IRQ memory.
void *STDCALL realloc_shared_aligned_mem(void *addr, size_t size, size_t alignment)
Reallocate a block of shared memory aligned on a multiple of the alignment value.
void *STDCALL get_nocache_mem(size_t size)
Allocate a block of non cached memory.
uint32_t STDCALL get_heap_block_max_ex(uint32_t state, uint32_t flags, uint32_t affinity)
Get the maximum size of current heap blocks based on state, flags and affinity.
uint32_t STDCALL mem_flags_irq(void *addr)
Return the flags of an allocated block of IRQ memory.
void *STDCALL alloc_local_aligned_mem(size_t size, size_t alignment, uint32_t affinity)
Allocate and clear a block of local memory aligned on a multiple of the alignment value.
HEAP_SNAPSHOT *STDCALL create_heap_snapshot(uint32_t state)
size_t STDCALL size_fiq_mem(void *addr)
Return the size of an allocated block of FIQ memory.
void *STDCALL alloc_code_mem(size_t size, uint32_t affinity)
Allocate and clear a block of code memory.
void *STDCALL realloc_aligned_mem_ex(void *addr, size_t size, size_t alignment, uint32_t flags, uint32_t affinity)
Reallocate a block of memory aligned on a multiple of the alignment value with the flags and affinity...
FPC_HEAP_STATUS STDCALL get_fpc_heap_status(void)
Return status information for the heap manager.
Definition heapmanager.h:227
uint32_t affinity
CPU Affinity of the Heap Block (eg CPU_AFFINITY_0).
Definition heapmanager.h:233
uint32_t state
State of the Heap Block (eg HEAP_STATE_FREE).
Definition heapmanager.h:231
uint32_t flags
Flags of the Heap Block (eg HEAP_FLAG_SHARED).
Definition heapmanager.h:232
size_t size
Size of the Heap Block (including the size of the THeapBlock structure).
Definition heapmanager.h:230
HEAP_SNAPSHOT * next
Next entry in Heap snapshot.
Definition heapmanager.h:235
size_t address
Address of the Heap Block.
Definition heapmanager.h:229
struct _FPC_HEAP_STATUS FPC_HEAP_STATUS
struct _HEAP_STATUS HEAP_STATUS