libctru
v2.4.1
|
VRAM allocator. More...
Go to the source code of this file.
Enumerations | |
enum | vramAllocPos { VRAM_ALLOC_A = BIT(0) , VRAM_ALLOC_B = BIT(1) , VRAM_ALLOC_ANY = VRAM_ALLOC_A | VRAM_ALLOC_B } |
Functions | |
void * | vramAlloc (size_t size) |
Allocates a 0x80-byte aligned buffer. More... | |
void * | vramAllocAt (size_t size, vramAllocPos pos) |
Allocates a 0x80-byte aligned buffer in the given VRAM bank. More... | |
void * | vramMemAlign (size_t size, size_t alignment) |
Allocates a buffer aligned to the given size. More... | |
void * | vramMemAlignAt (size_t size, size_t alignment, vramAllocPos pos) |
Allocates a buffer aligned to the given size in the given VRAM bank. More... | |
void * | vramRealloc (void *mem, size_t size) |
Reallocates a buffer. More... | |
size_t | vramGetSize (void *mem) |
Retrieves the allocated size of a buffer. More... | |
void | vramFree (void *mem) |
Frees a buffer. More... | |
u32 | vramSpaceFree (void) |
Gets the current VRAM free space. More... | |
VRAM allocator.
void* vramAlloc | ( | size_t | size | ) |
Allocates a 0x80-byte aligned buffer.
size | Size of the buffer to allocate. |
void* vramAllocAt | ( | size_t | size, |
vramAllocPos | pos | ||
) |
Allocates a 0x80-byte aligned buffer in the given VRAM bank.
size | Size of the buffer to allocate. |
pos | VRAM bank to use (see vramAllocPos). |
void vramFree | ( | void * | mem | ) |
Frees a buffer.
mem | Buffer to free. |
size_t vramGetSize | ( | void * | mem | ) |
Retrieves the allocated size of a buffer.
void* vramMemAlign | ( | size_t | size, |
size_t | alignment | ||
) |
Allocates a buffer aligned to the given size.
size | Size of the buffer to allocate. |
alignment | Alignment to use. |
void* vramMemAlignAt | ( | size_t | size, |
size_t | alignment, | ||
vramAllocPos | pos | ||
) |
Allocates a buffer aligned to the given size in the given VRAM bank.
size | Size of the buffer to allocate. |
alignment | Alignment to use. |
pos | VRAM bank to use (see vramAllocPos). |
void* vramRealloc | ( | void * | mem, |
size_t | size | ||
) |
Reallocates a buffer.
Note: Not implemented yet.
mem | Buffer to reallocate. |
size | Size of the buffer to allocate. |
u32 vramSpaceFree | ( | void | ) |
Gets the current VRAM free space.