OSAllocFixed

C Specification

#include <revolution/os.h>
void* OSAllocFixed (void** rstart, void** rend);

Arguments

rstart Pointer to the start address of the block.
rend Pointer to the end address of the block.

Return Values

Returns a null pointer if allocation is unsuccessful. If not, returns a pointer to the allocated region aligned to a 32-byte boundary. rstart and rend are adjusted to the actual boundaries of the allocated region, which is probably larger than the specified region.

Description

Although this function is provided for compatibility's sake, 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 noncontiguous, fragmented heaps. As an alternative, this effect can be achieved using OSAddToHeap. Other fixed blocks are not checked for any overlap. A size zero (zero length) heap can also be generated.

The allocation process must be initialized using the OSInitAlloc function first.

The OSAllocFixed function must be called before any calls to the OSAlloc function.

See Also

Memory Allocation Functions, OSInitAlloc,OSAddToHeap

Revision History

03/01/2006 Initial version.