Function Memory.allocAlign
allocAlign -- Allocate aligned memory
This function attempts to allocate memory at an aligned memory location. Often this is used by memory mappers (vmem). If there is not enough memory to satisfy the request, AllocAlign() will return null.
Parameters
Name | Description |
---|---|
byteSize | the size of the desired block in bytes This number is rounded up to the next larger block size for the actual allocation. |
alignment | the n value where the memory MUST be aligned to. ( 2^n memory boundary..) |
flags | (see. AllocMem() for flags.) |
Returns
memoryBlock - a pointer to the newly allocated memory block, or null if failed.
Notes
If the free list is corrupt, the system will panic with alert SEN_MemCorrupt.
The 8 bytes past the end of an AllocAbs will be changed by Exec relinking the next block of memory. Generally you can't trust the first MEM_BLOCKSIZE bytes of anything you AllocAbs().
Bugs
none
See
AllocMem(), AllocAbs()