# OS_AllocFrom*ArenaHi

## Syntax

      #include <nitro/os.h>

      void* OS_AllocFromArenaHi( OSArenaId id, u32 size, u32 alignment );

      void* OS_AllocFromMainArenaHi( u32 size, u32 alignment );
      void* OS_AllocFromSubArenaHi( u32 size, u32 alignment );
      void* OS_AllocFromMainExArenaHi( u32 size, u32 alignment );
      void* OS_AllocFromITCMArenaHi( u32 size, u32 alignment );
      void* OS_AllocFromDTCMArenaHi( u32 size, u32 alignment );
      void* OS_AllocFromSharedArenaHi( u32 size, u32 alignment );
      void* OS_AllocFromWramMainArenaHi( u32 size, u32 alignment );
      void* OS_AllocFromWramSubArenaHi( u32 size, u32 alignment );
      void* OS_AllocFromWramSubPrivArenaHi( u32 size, u32 alignment );

## Arguments

id | Arena ID
size | Size to be reserved
alignment | Alignment specification for the region's start address

## Return Values

The start address of the reserved region.

## Description

This function reserves a region from the top of an arena. `id` specifies an arena using an arena ID. For details on arena ID see `OS_InitArena()`. For details on arena ID, see `OS_InitArena()`. `size` specifies the size to be reserved in bytes. `alignment` specifies alignment for the reserved region. After the region is reserved, the arena's upper boundary address will be changed by the size of the region that was taken. Because no downward boundary check is performed, problems will occur if a region larger than the arena is reserved.

`OS_AllocFromMainArenaHi` is the inline function for `OS_AllocFromArenaHi( OS_ARENA_MAIN, ...` .
`OS_AllocFromSubPrivArenaHi` is the inline function for `OS_AllocFromArenaHi( OS_ARENA_MAIN_SUBPRIV, ...` .
`OS_AllocFromMainExArenaHi` is the inline function for `OS_AllocFromArenaHi( OS_ARENA_MAINEX, ...` .
`OS_AllocFromITCMArenaHi` is the inline function for `OS_AllocFromArenaHi( OS_ARENA_ITCM, ...` .
`OS_AllocFromDTCMArenaHi` is the inline function for `OS_AllocFromArenaHi( OS_ARENA_DTCM, ...` .
`OS_AllocFromSharedArenaHi` is the inline function for `OS_AllocFromArenaHi( OS_ARENA_SHARED, ...` .
`OS_AllocFromWramMainArenaHi` is the inline function for `OS_AllocFromArenaHi( OS_ARENA_WRAM, ...` .
`OS_AllocFromWramSubArenaHi` is the inline function for `OS_AllocFromArenaHi( OS_ARENA_WRAM, ...` .
`OS_AllocFromWramSubPrivArenaHi` is the inline function for `OS_AllocFromArenaHi( OS_ARENA_WRAM, ...`

## See Also

`OS_InitArena, OS_AllocFromArenaLo
`

## Revision History

2004/02/19 Changed the number of arenas from 6 to 9.
2004/01/06 Initial version.

CONFIDENTIAL