# OS_DestroyHeap

## Syntax

      #include <nitro/os.h>

      void OS_DestroyHeap( OSArenaId id, OSHeapHandle heap );

## Arguments

`id` | The arena from which the heap to be destroyed.
`heap` | The handle of the heap to be destroyed.

## Return Values

None.

## Description

Destroys a heap region.

The arena is specified by an arena ID. To read more about this value, see the `OS_InitArena` function.

In the case of a DEBUG build, build stops on an assert if an attempt is made to use a function such as `OS_AllocFromHeap` to allocate memory for a heap destroyed using the `OS_DestroyHeap` function. Returns `NULL` in the case of RELEASE and FINALROM builds.

## See Also

`OS_CreateHeap`
`OS_AllocFromHeap`

## Revision History

2004/01/06 Initial version.

CONFIDENTIAL