IBNOS
|
Functions | |
void * | heapAlloc (uint32_t length) |
Allocates a block of kernel memory. More... | |
void | heapFree (void *addr) |
Deallocates a block of kernel memory. More... | |
uint32_t | heapSize (void *addr) |
Determines the size of a specific kernel memory block. More... | |
void * | heapReAlloc (void *addr, uint32_t length) |
Resizes a block of kernel memory. More... | |
void | heapVerify () |
Runs some internal checks to ensure that the heap is still valid. More... | |
void* heapAlloc | ( | uint32_t | length | ) |
Allocates a block of kernel memory.
Allocates a block of kernel memory of the requested size. The algorithm will always return a pointer aligned to a 16-byte boundary, or NULL if the request cannot be fulfilled. The new memory block will not be initialized.
length | Number of bytes to allocate |
Definition at line 363 of file allocator.c.
void heapFree | ( | void * | addr | ) |
Deallocates a block of kernel memory.
Verifies that the provided memory pointer is valid, and afterwards releases the full block. If something goes wrong an assertion is thrown. This typically means that the application has corrupted the block header.
addr | Pointer to a memory block allocated with heapAlloc() |
Definition at line 385 of file allocator.c.
void* heapReAlloc | ( | void * | addr, |
uint32_t | length | ||
) |
Resizes a block of kernel memory.
Provides a fast method to change the size of a memory block. If the return value is NULL then it was impossible to fulfill the request (for example not enough memory left). Otherwise this function returns a pointer to the new location of the memory block, which can be, but is not necessarily equal to the previous location. The new bytes of memory are not initialized before this function returns.
addr | Pointer to a memory block |
length | New requested length |
Definition at line 439 of file allocator.c.
uint32_t heapSize | ( | void * | addr | ) |
Determines the size of a specific kernel memory block.
Returns the number of bytes of a specific kernel memory block. The result of this function can be greater than the requested size specified when calling heapAlloc() due to align issues.
addr | Pointer to a memory block allocated with heapAlloc() |
Definition at line 411 of file allocator.c.
void heapVerify | ( | ) |
Runs some internal checks to ensure that the heap is still valid.
Definition at line 485 of file allocator.c.