# FreeAnalysisMem

Advanced Analysis Library Only

void FreeAnalysisMem (void *pointer);

## Purpose

Frees the memory that PeakDetector allocated internally for the output arguments.

The following code example shows how to use FreeAnalysisMem in conjunction with PeakDetector.

main()

{

double *x = NULL;

double *amplitudes = NULL;

double *locations = NULL;

double *secondDerivatives = NULL;

err = 0;

xSize;

/* Insert code here to determine xSize. */

x = (double *)malloc (xSize * sizeof(double));

err = PeakDetector(x, xSize, 0.01, 3, 0, 1, 0, &count, &locations, &amplitudes, &secondDerivatives);

/* Memory is allocated internally by the PeakDetector function for the locations, amplitudes and second_derivatives outputs. Use the FreeAnalysisMem function to free this memory. */

FreeAnalysisMem(locations);

FreeAnalysisMem(amplitudes);

FreeAnalysisMem(secondDerivatives);
}

## Parameters

Input
Name | Type | Description
pointer | void pointer | Pointer to the memory to free.

## Return Value

None.