Alloc
Signature
Description
Allocates memory from the main pool, always aligned to the nearest 16 bytes.
Returns the starting address to the allocated memory, or 0
if allocation fails.
Arguments
Size
The amount of memory to allocate, in bytes.
Clear
If set to true
, the memory will be cleared. If set to false
, the memory will remain uninitialized.
Is optional and set to true
by default.
Notes
Although memory can be allocated in the 32-bit address space, it is not guaranteed and may only apply during the early stages of game execution. Therefore, it should not be used with file formats that only support 32-bit pointers (mrp).
Always deallocate memory that is no longer used to avoid memory leaks.
Last updated