# OS_DestroyHeap

## Syntax

      #include <nitro/os.h>

      void OS_DestroyHeap( OSArenaId id, OSHeapHandle heap );

## Arguments

id | Arena from which the heap to be destroyed.
heap | Handle of the heap to be destroyed.

## Return Values

None.

## Description

Destroys a heap region.

Arena id specifies the arena ID. For more information on this value, see the `OS_InitArena` function.

Not only heaps created using the `OS_CreateHeap` function, but also special heaps created by the `OS_CreateExtraHeap` function can be destroyed by this function.

For DEBUG builds, the build stops on an assert if an attempt is made using the `OS_AllocFromHeap` function to allocate a region for a heap destroyed by this function. Returns `NULL` in the case of RELEASE and FINALROM builds.

## See Also

`OS_CreateHeap`
`OS_AllocFromHeap`
`OS_CreateExtraHeap`

## Revision History

2009/04/03 Added description that the function can also be used for special heaps as well.
2004/01/06 Initial version.

CONFIDENTIAL