Ultibo API
C/C++ API for Ultibo Core
Loading...
Searching...
No Matches
heapmanager.h File Reference

Go to the source code of this file.

Data Structures

struct  _HEAP_SNAPSHOT

Macros

#define HEAP_MIN_BLOCK   33
 SizeOf(THeapBlock) + 1.
#define HEAP_MIN_ALIGN   64
 SizeOf(THeapBlock) * 2.
#define HEAP_SIGNATURE   0xE84DF600
#define HEAP_SIGNATURE_MASK   0xFFFFFF00
#define HEAP_STATE_FREE   0
#define HEAP_STATE_USED   1
#define HEAP_STATE_MASK   0x000000FF
#define HEAP_STATE_ALL   2
 Only for use by GetHeapBlockCount/GetHeapBlockMin/GetHeapBlockMax.
#define HEAP_FLAG_NORMAL   0x00000000
 A normal memory block.
#define HEAP_FLAG_SHARED   0x00000001
 A sharable memory block, usually marked as sharable in the page tables of the memory management unit.
#define HEAP_FLAG_LOCAL   0x00000002
 A local memory block with an affinity to a specific processor, usually marked as non global in the page tables of the memory management unit.
#define HEAP_FLAG_CODE   0x00000004
 A code memory block (with an optional affinity to a specific processor), usually marked as executable in the page tables of the memory management unit.
#define HEAP_FLAG_DEVICE   0x00000008
 A device memory block, usually marked as device memory in the page tables of the memory management unit.
#define HEAP_FLAG_NOCACHE   0x00000010
 A non cached memory block, usually marked as not cacheable in the page tables of the memory management unit.
#define HEAP_FLAG_NONSHARED   0x00000020
 A non shared memory block, usually marked as not shareable in the page tables of the memory management unit.
#define HEAP_FLAG_LOCKED   0x00000040
 A locked memory block (Not currently implemented in Ultibo).
#define HEAP_FLAG_IRQ   0x00000080
 An IRQ allocatable memory block.
#define HEAP_FLAG_FIQ   0x00000100
 An FIQ allocatable memory block.
#define HEAP_FLAG_RECLAIM   0x00000200
 A reclaimable memory block (eg Disk Cache)(with a registered callback to reclaim as required for normal memory).
#define HEAP_FLAG_CUSTOM   0x08000000
 A custom flag reserved for non standard uses.
#define HEAP_FLAG_ALL   0xFFFFFFFF
 Only for use by GetHeapBlockCount/GetHeapBlockMin/GetHeapBlockMax.
#define HEAP_FLAG_INVALID   0xFFFFFFFF
 Return value from MemFlags/IRQ/FIQ on invalid.
#define HEAP_SMALL_MIN   32
 SizeOf(THeapBlock).
#define HEAP_SMALL_MAX   SIZE_4K
 Maximum size of a small heap block.
#define HEAP_SMALL_ALIGN   4
 SizeOf(LongWord);.
#define HEAP_SMALL_SHIFT   2
 Size to Index conversion (Divide by 4).
#define HEAP_SMALL_LOW   (HEAP_SMALL_MIN / HEAP_SMALL_ALIGN)
 8 (32-bit) / 14 (64-bit)
#define HEAP_SMALL_HIGH   (HEAP_SMALL_MAX / HEAP_SMALL_ALIGN)
 1024

Typedefs

typedef struct _HEAP_SNAPSHOT HEAP_SNAPSHOT

Functions

void *STDCALL get_mem (size_t size)
 Allocate a block of normal 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_aligned_mem (size_t size, size_t alignment)
 Allocate a block of normal memory aligned on a multiple of the alignment value.
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 requested.
void *STDCALL get_shared_mem (size_t size)
 Allocate a block of shared 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 get_local_mem (size_t size, uint32_t affinity)
 Allocate a block of local memory.
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.
void *STDCALL get_code_mem (size_t size, uint32_t affinity)
 Allocate a block of code memory.
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.
void *STDCALL get_device_mem (size_t size)
 Allocate a block of device memory.
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_nocache_mem (size_t size)
 Allocate a block of non cached memory.
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_nonshared_mem (size_t size)
 Allocate a block of non shared 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 get_irq_mem (size_t size, uint32_t affinity)
 Allocate a block of IRQ memory.
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.
void *STDCALL get_fiq_mem (size_t size, uint32_t affinity)
 Allocate a block of FIQ memory.
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.
size_t STDCALL free_mem (void *addr)
 Free a block of memory.
size_t STDCALL free_irq_mem (void *addr)
 Free a block of IRQ memory.
size_t STDCALL free_fiq_mem (void *addr)
 Free a block of FIQ memory.
void *STDCALL alloc_mem (size_t size)
 Allocate and clear a block of normal 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 realloc_mem (void *addr, size_t size)
 Reallocate a block of normal 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 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_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 flags and affinity requested.
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_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 requested.
void *STDCALL alloc_shared_mem (size_t size)
 Allocate and clear a block of shared memory.
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 realloc_shared_mem (void *addr, size_t size)
 Reallocate a block of shared 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 alloc_local_mem (size_t size, uint32_t affinity)
 Allocate and clear a block of local 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.
void *STDCALL realloc_local_mem (void *addr, size_t size, uint32_t affinity)
 Reallocate a block of local 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 alloc_code_mem (size_t size, uint32_t affinity)
 Allocate and clear a block of code 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 realloc_code_mem (void *addr, size_t size, uint32_t affinity)
 Reallocate a block of code memory.
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.
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_device_mem (void *addr, size_t size)
 Reallocate a block of device 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 alloc_nocache_mem (size_t size)
 Allocate and clear a block of non cached memory.
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 realloc_nocache_mem (void *addr, size_t size)
 Reallocate a block of non cached 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_nonshared_mem (size_t size)
 Allocate and clear a block of non shared memory.
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.
void *STDCALL realloc_nonshared_mem (void *addr, size_t size)
 Reallocate a block of non shared memory.
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 alloc_irq_mem (size_t size, uint32_t affinity)
 Allocate and clear a block of IRQ memory.
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 realloc_irq_mem (void *addr, size_t size, uint32_t affinity)
 Reallocate a block of IRQ memory.
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 alloc_fiq_mem (size_t size, uint32_t affinity)
 Allocate and clear 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 realloc_fiq_mem (void *addr, size_t size, uint32_t affinity)
 Reallocate a block of FIQ memory.
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.
size_t STDCALL size_mem (void *addr)
 Return the size of an allocated block of memory.
size_t STDCALL size_irq_mem (void *addr)
 Return the size of an allocated block of IRQ memory.
size_t STDCALL size_fiq_mem (void *addr)
 Return the size of an allocated block of FIQ memory.
uint32_t STDCALL mem_flags (void *addr)
 Return the flags of an allocated block of memory.
uint32_t STDCALL mem_flags_irq (void *addr)
 Return the flags of an allocated block of IRQ memory.
uint32_t STDCALL mem_flags_fiq (void *addr)
 Return the flags of an allocated block of FIQ memory.
HEAP_STATUS STDCALL get_heap_status (void)
 Return status information for the heap manager.
FPC_HEAP_STATUS STDCALL get_fpc_heap_status (void)
 Return status information for the heap manager.
uint32_t STDCALL get_heap_block_count (uint32_t state)
 Get the total number of current heap blocks based on state.
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.
uint32_t STDCALL get_heap_block_min (uint32_t state)
 Get the minimum size of current heap blocks based on state.
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.
uint32_t STDCALL get_heap_block_max (uint32_t state)
 Get the maximum size of current heap blocks based on state.
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.
HEAP_SNAPSHOT *STDCALL create_heap_snapshot (uint32_t state)
HEAP_SNAPSHOT *STDCALL create_heap_snapshot_ex (uint32_t state, uint32_t flags, uint32_t affinity)
uint32_t STDCALL destroy_heap_snapshot (HEAP_SNAPSHOT *snapshot)

Macro Definition Documentation

◆ HEAP_MIN_BLOCK

#define HEAP_MIN_BLOCK   33

SizeOf(THeapBlock) + 1.

Note: Memory allocated using these functions must not be freed using free() or heap corruption may occur. Allocations obtained from these functions must be freed with free_mem(), free_irq_mem() or free_fiq_mem() only Heap specific constants

◆ HEAP_MIN_ALIGN

#define HEAP_MIN_ALIGN   64

SizeOf(THeapBlock) * 2.

◆ HEAP_SIGNATURE

#define HEAP_SIGNATURE   0xE84DF600

Heap Signature

◆ HEAP_SIGNATURE_MASK

#define HEAP_SIGNATURE_MASK   0xFFFFFF00

◆ HEAP_STATE_FREE

#define HEAP_STATE_FREE   0

Heap Block States

◆ HEAP_STATE_USED

#define HEAP_STATE_USED   1

◆ HEAP_STATE_MASK

#define HEAP_STATE_MASK   0x000000FF

◆ HEAP_STATE_ALL

#define HEAP_STATE_ALL   2

Only for use by GetHeapBlockCount/GetHeapBlockMin/GetHeapBlockMax.

◆ HEAP_FLAG_NORMAL

#define HEAP_FLAG_NORMAL   0x00000000

A normal memory block.

Heap Block Flags

◆ HEAP_FLAG_SHARED

#define HEAP_FLAG_SHARED   0x00000001

A sharable memory block, usually marked as sharable in the page tables of the memory management unit.

◆ HEAP_FLAG_LOCAL

#define HEAP_FLAG_LOCAL   0x00000002

A local memory block with an affinity to a specific processor, usually marked as non global in the page tables of the memory management unit.

◆ HEAP_FLAG_CODE

#define HEAP_FLAG_CODE   0x00000004

A code memory block (with an optional affinity to a specific processor), usually marked as executable in the page tables of the memory management unit.

◆ HEAP_FLAG_DEVICE

#define HEAP_FLAG_DEVICE   0x00000008

A device memory block, usually marked as device memory in the page tables of the memory management unit.

◆ HEAP_FLAG_NOCACHE

#define HEAP_FLAG_NOCACHE   0x00000010

A non cached memory block, usually marked as not cacheable in the page tables of the memory management unit.

◆ HEAP_FLAG_NONSHARED

#define HEAP_FLAG_NONSHARED   0x00000020

A non shared memory block, usually marked as not shareable in the page tables of the memory management unit.

◆ HEAP_FLAG_LOCKED

#define HEAP_FLAG_LOCKED   0x00000040

A locked memory block (Not currently implemented in Ultibo).

◆ HEAP_FLAG_IRQ

#define HEAP_FLAG_IRQ   0x00000080

An IRQ allocatable memory block.

◆ HEAP_FLAG_FIQ

#define HEAP_FLAG_FIQ   0x00000100

An FIQ allocatable memory block.

◆ HEAP_FLAG_RECLAIM

#define HEAP_FLAG_RECLAIM   0x00000200

A reclaimable memory block (eg Disk Cache)(with a registered callback to reclaim as required for normal memory).

◆ HEAP_FLAG_CUSTOM

#define HEAP_FLAG_CUSTOM   0x08000000

A custom flag reserved for non standard uses.

◆ HEAP_FLAG_ALL

#define HEAP_FLAG_ALL   0xFFFFFFFF

Only for use by GetHeapBlockCount/GetHeapBlockMin/GetHeapBlockMax.

◆ HEAP_FLAG_INVALID

#define HEAP_FLAG_INVALID   0xFFFFFFFF

Return value from MemFlags/IRQ/FIQ on invalid.

◆ HEAP_SMALL_MIN

#define HEAP_SMALL_MIN   32

SizeOf(THeapBlock).

Heap Small Blocks

◆ HEAP_SMALL_MAX

#define HEAP_SMALL_MAX   SIZE_4K

Maximum size of a small heap block.

◆ HEAP_SMALL_ALIGN

#define HEAP_SMALL_ALIGN   4

SizeOf(LongWord);.

◆ HEAP_SMALL_SHIFT

#define HEAP_SMALL_SHIFT   2

Size to Index conversion (Divide by 4).

◆ HEAP_SMALL_LOW

#define HEAP_SMALL_LOW   (HEAP_SMALL_MIN / HEAP_SMALL_ALIGN)

8 (32-bit) / 14 (64-bit)

◆ HEAP_SMALL_HIGH

#define HEAP_SMALL_HIGH   (HEAP_SMALL_MAX / HEAP_SMALL_ALIGN)

1024

Typedef Documentation

◆ HEAP_SNAPSHOT

typedef struct _HEAP_SNAPSHOT HEAP_SNAPSHOT

Heap specific types

Function Documentation

◆ get_mem()

void *STDCALL get_mem ( size_t size)

Allocate a block of normal memory.

Heap Functions

◆ get_mem_ex()

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.

◆ get_aligned_mem()

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.

Note
Alignment must be a power of 2

◆ get_aligned_mem_ex()

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 requested.

Note
Alignment must be a power of 2

◆ get_shared_mem()

void *STDCALL get_shared_mem ( size_t size)

Allocate a block of shared memory.

◆ get_shared_aligned_mem()

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.

Note
Alignment must be a power of 2

◆ get_local_mem()

void *STDCALL get_local_mem ( size_t size,
uint32_t affinity )

Allocate a block of local memory.

◆ get_local_aligned_mem()

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.

Note
Alignment must be a power of 2

◆ get_code_mem()

void *STDCALL get_code_mem ( size_t size,
uint32_t affinity )

Allocate a block of code memory.

◆ get_code_aligned_mem()

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.

Note
Alignment must be a power of 2

◆ get_device_mem()

void *STDCALL get_device_mem ( size_t size)

Allocate a block of device memory.

◆ get_device_aligned_mem()

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.

Note
Alignment must be a power of 2

◆ get_nocache_mem()

void *STDCALL get_nocache_mem ( size_t size)

Allocate a block of non cached memory.

◆ get_nocache_aligned_mem()

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.

Note
Alignment must be a power of 2

◆ get_nonshared_mem()

void *STDCALL get_nonshared_mem ( size_t size)

Allocate a block of non shared memory.

◆ get_nonshared_aligned_mem()

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.

Note
Alignment must be a power of 2

◆ get_irq_mem()

void *STDCALL get_irq_mem ( size_t size,
uint32_t affinity )

Allocate a block of IRQ memory.

Note
The memory must be freed using FreeIRQMem

◆ get_irq_aligned_mem()

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.

Note
Alignment must be a power of 2
The memory must be freed using FreeIRQMem

◆ get_fiq_mem()

void *STDCALL get_fiq_mem ( size_t size,
uint32_t affinity )

Allocate a block of FIQ memory.

Note
The memory must be freed using FreeFIQMem

◆ get_fiq_aligned_mem()

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.

Note
Alignment must be a power of 2
The memory must be freed using FreeFIQMem

◆ free_mem()

size_t STDCALL free_mem ( void * addr)

Free a block of memory.

◆ free_irq_mem()

size_t STDCALL free_irq_mem ( void * addr)

Free a block of IRQ memory.

◆ free_fiq_mem()

size_t STDCALL free_fiq_mem ( void * addr)

Free a block of FIQ memory.

◆ alloc_mem()

void *STDCALL alloc_mem ( size_t size)

Allocate and clear a block of normal memory.

Note
Not inlined to AllocMemEx to save extra call from memory manager

◆ alloc_mem_ex()

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.

◆ realloc_mem()

void *STDCALL realloc_mem ( void * addr,
size_t size )

Reallocate a block of normal memory.

◆ realloc_mem_ex()

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.

◆ alloc_aligned_mem()

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.

Note
Alignment must be a power of 2

◆ alloc_aligned_mem_ex()

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 flags and affinity requested.

Note
Alignment must be a power of 2

◆ realloc_aligned_mem()

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.

Note
Alignment must be a power of 2

◆ realloc_aligned_mem_ex()

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 requested.

Note
Alignment must be a power of 2

◆ alloc_shared_mem()

void *STDCALL alloc_shared_mem ( size_t size)

Allocate and clear a block of shared memory.

◆ alloc_shared_aligned_mem()

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.

Note
Alignment must be a power of 2

◆ realloc_shared_mem()

void *STDCALL realloc_shared_mem ( void * addr,
size_t size )

Reallocate a block of shared memory.

◆ realloc_shared_aligned_mem()

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.

Note
Alignment must be a power of 2

◆ alloc_local_mem()

void *STDCALL alloc_local_mem ( size_t size,
uint32_t affinity )

Allocate and clear a block of local memory.

◆ alloc_local_aligned_mem()

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.

Note
Alignment must be a power of 2

◆ realloc_local_mem()

void *STDCALL realloc_local_mem ( void * addr,
size_t size,
uint32_t affinity )

Reallocate a block of local memory.

◆ realloc_local_aligned_mem()

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.

Note
Alignment must be a power of 2

◆ alloc_code_mem()

void *STDCALL alloc_code_mem ( size_t size,
uint32_t affinity )

Allocate and clear a block of code memory.

◆ alloc_code_aligned_mem()

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.

Note
Alignment must be a power of 2

◆ realloc_code_mem()

void *STDCALL realloc_code_mem ( void * addr,
size_t size,
uint32_t affinity )

Reallocate a block of code memory.

◆ realloc_code_aligned_mem()

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.

Note
Alignment must be a power of 2

◆ alloc_device_mem()

void *STDCALL alloc_device_mem ( size_t size)

Allocate and clear a block of device memory.

◆ alloc_device_aligned_mem()

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.

Note
Alignment must be a power of 2

◆ realloc_device_mem()

void *STDCALL realloc_device_mem ( void * addr,
size_t size )

Reallocate a block of device memory.

◆ realloc_device_aligned_mem()

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.

Note
Alignment must be a power of 2

◆ alloc_nocache_mem()

void *STDCALL alloc_nocache_mem ( size_t size)

Allocate and clear a block of non cached memory.

◆ alloc_nocache_aligned_mem()

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.

Note
Alignment must be a power of 2

◆ realloc_nocache_mem()

void *STDCALL realloc_nocache_mem ( void * addr,
size_t size )

Reallocate a block of non cached memory.

◆ realloc_nocache_aligned_mem()

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.

Note
Alignment must be a power of 2

◆ alloc_nonshared_mem()

void *STDCALL alloc_nonshared_mem ( size_t size)

Allocate and clear a block of non shared memory.

◆ alloc_nonshared_aligned_mem()

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.

Note
Alignment must be a power of 2

◆ realloc_nonshared_mem()

void *STDCALL realloc_nonshared_mem ( void * addr,
size_t size )

Reallocate a block of non shared memory.

◆ realloc_nonshared_aligned_mem()

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.

Note
Alignment must be a power of 2

◆ alloc_irq_mem()

void *STDCALL alloc_irq_mem ( size_t size,
uint32_t affinity )

Allocate and clear a block of IRQ memory.

Note
The memory must be freed using FreeIRQMem

◆ alloc_irq_aligned_mem()

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.

Note
Alignment must be a power of 2
The memory must be freed using FreeIRQMem

◆ realloc_irq_mem()

void *STDCALL realloc_irq_mem ( void * addr,
size_t size,
uint32_t affinity )

Reallocate a block of IRQ memory.

Note
The memory must be freed using FreeIRQMem

◆ realloc_irq_aligned_mem()

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.

Note
Alignment must be a power of 2
The memory must be freed using FreeIRQMem

◆ alloc_fiq_mem()

void *STDCALL alloc_fiq_mem ( size_t size,
uint32_t affinity )

Allocate and clear a block of FIQ memory.

Note
The memory must be freed using FreeFIQMem

◆ alloc_fiq_aligned_mem()

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.

Note
Alignment must be a power of 2
The memory must be freed using FreeFIQMem

◆ realloc_fiq_mem()

void *STDCALL realloc_fiq_mem ( void * addr,
size_t size,
uint32_t affinity )

Reallocate a block of FIQ memory.

Note
The memory must be freed using FreeFIQMem

◆ realloc_fiq_aligned_mem()

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.

Note
Alignment must be a power of 2
The memory must be freed using FreeFIQMem

◆ size_mem()

size_t STDCALL size_mem ( void * addr)

Return the size of an allocated block of memory.

◆ size_irq_mem()

size_t STDCALL size_irq_mem ( void * addr)

Return the size of an allocated block of IRQ memory.

◆ size_fiq_mem()

size_t STDCALL size_fiq_mem ( void * addr)

Return the size of an allocated block of FIQ memory.

◆ mem_flags()

uint32_t STDCALL mem_flags ( void * addr)

Return the flags of an allocated block of memory.

◆ mem_flags_irq()

uint32_t STDCALL mem_flags_irq ( void * addr)

Return the flags of an allocated block of IRQ memory.

◆ mem_flags_fiq()

uint32_t STDCALL mem_flags_fiq ( void * addr)

Return the flags of an allocated block of FIQ memory.

◆ get_heap_status()

HEAP_STATUS STDCALL get_heap_status ( void )

Return status information for the heap manager.

◆ get_fpc_heap_status()

FPC_HEAP_STATUS STDCALL get_fpc_heap_status ( void )

Return status information for the heap manager.

◆ get_heap_block_count()

uint32_t STDCALL get_heap_block_count ( uint32_t state)

Get the total number of current heap blocks based on state.

◆ get_heap_block_count_ex()

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.

Note
This uses the block list (not the Free/Used/Small lists) in order to account for all blocks

◆ get_heap_block_min()

uint32_t STDCALL get_heap_block_min ( uint32_t state)

Get the minimum size of current heap blocks based on state.

◆ get_heap_block_min_ex()

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.

Note
This uses the block list (not the Free/Used/Small lists) in order to account for all blocks

◆ get_heap_block_max()

uint32_t STDCALL get_heap_block_max ( uint32_t state)

Get the maximum size of current heap blocks based on state.

◆ get_heap_block_max_ex()

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.

Note
This uses the block list (not the Free/Used/Small lists) in order to account for all blocks

◆ create_heap_snapshot()

HEAP_SNAPSHOT *STDCALL create_heap_snapshot ( uint32_t state)

◆ create_heap_snapshot_ex()

HEAP_SNAPSHOT *STDCALL create_heap_snapshot_ex ( uint32_t state,
uint32_t flags,
uint32_t affinity )

◆ destroy_heap_snapshot()

uint32_t STDCALL destroy_heap_snapshot ( HEAP_SNAPSHOT * snapshot)