OS_AllocFixed


C Specification

#include <nitro/os.h>

void* OS_AllocFixed( 
            OSArenaId   id , 
            void**      rstart , 
            void**      rend );

Description

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*().

Arguments

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.

Return Values

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.

See Also

OS_InitArena, OS_AddToHeap, OS_AllocFromHeap

Revision History

01/06/2004 Initial Version