# OS_CheckFunctionCostBuffer

## Syntax

  `#include <nitro/os.h>`
  `BOOL OS_CheckFunctionCostBuffer( void* buf );`

## Arguments

buf | Function cost calculation buffer

## Return Values

Returns FALSE if the highest-order position of the buffer is overwritten.
Otherwise, returns FALSE.

## Description

Checks whether the highest-order position of the function cost calculation buffer was overwritten.
That is, it will check whether the function cost calculation buffer is full.

The function cost calculation buffer is consumed every time a function is called. Once full, the buffer will simply stop recording function calls and will not display error messages or stop programs.

The mechanism for detecting the full buffer is as follows. Write a check code to the highest-order position of the buffer. Check whether this code is overwritten by another value. A different value written here indicates a high probability that the buffer was used up to that point. However, this only indicates the use of this region; it does not give the time at which the use occurred.

The check code is written at the following times. When `OS_InitFunctionCostBuffer()` is loaded. When, through the use of the `OS_CalcStatistics()` or `OS_CalcThreadStatistics()` function, the contents of the calculation buffer is reflected to the statistics buffer. When the buffer is destroyed with the `OS_ClearFunctionCostBuffer()` function.

This is a debug function, so in the final ROM version (FINALROM), it will simply return TRUE.

For checking the function cost statistics buffer, `OS_CheckStatisticsBuffer()` is available.

## See Also

`OS_InitFunctionCostBuffer, OS_CheckStatisticsBuffer, OS_CalcStatistics, OS_CalcThreadStatistics, OS_ClearFunctionCostBuffer`

## Revision History

2006/08/24 Initial version.

CONFIDENTIAL