Jump to content

SOMFree

From EDM2

This function frees the specified block of memory.

Syntax

void (*somFree) (somToken ptr)

Parameters

ptr (somToken)
A pointer to the block of storage to be freed.

Return Code

rc (void)

Remarks

This function frees the block of memory pointed to by ptr. This function should only be called with a pointer previously allocated by SOMMalloc or SOMCalloc. This function has the same interface as the C free function. It performs the same basic function as free with some supplemental error checking. If an error occurs, the SOMError function is called. This routine is replaceable by changing the value of the global variable SOMFree.

To free an object (rather than a block of memory), use the somFree method, rather than this function.

Example Code

#include <som.h>
main()
{
   somToken ptr = SOMMalloc(20);
   SOMFree(ptr);
}

Related

Functions

Methods