# NNS_FndCreateExpHeapEx

## Syntax

      #include <nnsys/fnd.h>

      NNSFndHeapHandle    NNS_FndCreateExpHeapEx(
      	                        void*   startAddress,
      	                        u32     size,
      	                        u16     optFlag);

## Arguments

startAddress | Starting address of the memory region allocated to the heap.
size | Size (in bytes) of the memory region allocated to the heap.
optFlag | Heap options (see below for more details)

## Return Values

In the case that it was possible to create a heap, the handle to the heap will be returned. If the function fails, it returns `NNS_FND_HEAP_INVALID_HANDLE` (a NULL value).

## Description

Creates the extended heap. The region for the heap is a memory region of a size designated by `size` from the address designated with `startAddress`.

You can set the heap options with `optFlag`.

NNS_FND_HEAP_OPT_0_CLEAR | The allocated memory block is filled with `0`s at the time the memory is allocated from the heap.
NNS_FND_HEAP_OPT_DEBUG_FILL | When the heap is created, and when the memory block is allocated or deallocated, each is filled with a different 32-bit value in the memory region. This flag is for debugging, and is used in finding memory access bugs caused by a failure to initialize memory and invalid memory regions. This has no function with the `FINALROM` library.

## See Also

`NNS_FndCreateExpHeap
`

## Revision History

2004/10/15 Corrected argument reference(s).
2004/04/28 Corrected the value in case the heap could not be created.
2004/04/01 Initial version.

CONFIDENTIAL