#include <nitro/os.h>
void* OS_AllocFixed(
OSArenaId id ,
void** rstart ,
void** rend );
Allocates a specified region
The arena is specified by an arena ID, id.
See OS_InitArena for information.
Areas overlapping memory blocks of other heaps in the arena will be erased from the heap which can cause non-contiguous, fragmented heaps. Using OS_AddToHeap could also cause this phenomenon.
Since no check is made for any overlap of other fixed blocks. A 0-sized (zero-length) heap could also be generated.
The OS_AllocFixed function must be called before any other call related to OS_Alloc*().
id |
Arena ID of the arena associated with the region that will be allocated. |
rstart |
Pointer to a block start address. |
rend |
Pointer to a block end address. |
If the specified block has been allocated, the 32-byte aligned start address is returned. If rstart and rend are larger than the region requested, they will be revised to the region's actual start and end address.
OS_InitArena, OS_AddToHeap, OS_AllocFromHeap
01/06/2004 Initial Version