mirror of
https://github.com/AsahiLinux/m1n1
synced 2025-02-16 21:58:27 +00:00
heapblock: Assert if not initialized
Signed-off-by: Hector Martin <marcan@marcan.st>
This commit is contained in:
parent
9ffab4ac98
commit
7685800b45
1 changed files with 1 additions and 0 deletions
|
@ -40,6 +40,7 @@ void *heapblock_alloc(size_t size)
|
|||
void *heapblock_alloc_aligned(size_t size, size_t align)
|
||||
{
|
||||
assert((align & (align - 1)) == 0);
|
||||
assert(heap_base);
|
||||
|
||||
uintptr_t block = (((uintptr_t)heap_base) + align - 1) & ~(align - 1);
|
||||
heap_base = (void *)(block + size);
|
||||
|
|
Loading…
Add table
Reference in a new issue