# OS_GetMaxFreeSize

## C Specification

      #include <nitro/os.h>

      u32 OS_GetMaxFreeSize( OSArenaId id, OSHeapHandle heap );

## Description

This function gets the size of the largest free block in the heap.

Set OS_CURRENT_HEAP_HANDLE in heap to specify the current heap.

The size refers to the free block's data region. The free block's header is not included in the size value.

All free blocks are tracked down and calculated, so the time required for the process is proportional to the amount of memory blocks.

## Arguments

id | Arena ID of the arena for the heap from which the largest block is obtained
heap | Heap handle of the heap from which the largest block is obtained

## Return Values

The size (in bytes) of the largest free block in the heap.

## See Also

`OS_InitAlloc, OS_GetTotalAllocSize, OS_GetTotalFreeSize`

## History

11/05/2004 Initial Version