# OS_AllocFixed

## C Specification

      #include <nitro/os.h>

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

## 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.

## Description

Allocate the specified region.

The arena is specified with the arena ID (id). To read more about this value, see `OS_InitArena()`. Areas overlapping memory blocks of other heaps in the arena will be erased from the heap. This can cause non-contiguous, fragmented heaps. Using `OS_AddToHeap` could also cause this phenomenon. 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*()`.

## See Also

`OS_InitArena, OS_AddToHeap, OS_AllocFromHeap
`

## Revision History

01/06/2004 Initial version