# OS_ClearHeap

## C Specification

      #include <nitro/os.h>

      void OS_ClearHeap( OSArenaId id, OSHeapHandle heap, void* start, void* end );

## Arguments

id | Arena ID of the arena that includes the heap being cleared
heap | Heap handler for the heap being cleared
start | Starting address of heap region
end | Ending address of address of heap region (+1)

## Return Values

None.

## Description

This function clears and initializes an existing heap.

All memory blocks secured in heap get destroyed. Specify the heap region using start and end. Be careful when initializing the heap, because if there is an isolated region of heap due to the use of `OS_AddToHeap()`, that region will not be initialized. Moreover, upon initialization, that region will be removed from a part. Caution should be exercised when initializing the heap.

## See Also

`OS_InitAlloc OS_AddToHeap
`

## Revision History

11/08/2004 Initial Version

CONFIDENTIAL