#include <revolution/os.h> void* OSAllocFixed(void** rstart, void** rend);
rstart |
Pointer to the start address of the block. |
|---|---|
rend |
Pointer to the end address of the block. |
Returns a null pointer if allocation is unsuccessful. Otherwise, returns a pointer to the 32-byte aligned region that was allocated. rstart and rend are used to correct the boundaries of the region since an amount of memory greater than required was probably actually allocated.
Although this function is provided for compatibility, we recommend using the MEM library.
Creates a block of memory that starts at rstart and ends at rend. Any overlaps in memory in heap will be removed from that heap. This can cause non-contiguous, fragmented heaps. As an alternative, this effect can be achieved using OSAddToHeap. No check is made for any overlap of other fixed blocks. A 0-sized (zero-length) heap could also be generated.
Allocation services must have been initialized with OSInitAlloc first.
OSAllocFixed must be called before any calls are made to OSAlloc.
Memory Allocation Functions, OSInitAlloc, OSAddToHeap
2006/03/01 Initial version.
CONFIDENTIAL