SOM Kernel Reference 1-43
SOMFree Function
Purpose
Frees the specified block of memory.
Syntax
void (*SOMFree) (somToken ptr);
Description
The SOMFree function frees the block of memory pointed to by ptr. SOMFree should only
be called with a pointer previously allocated by SOMMalloc or SOMCalloc. The SOMFree
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.
Parameters
ptr A pointer to the block of storage to be freed.
C Example
#include <som.h>
main()
{
somToken ptr = SOMMalloc(20);
. . .
somFree(ptr);
}
Related Information
Functions: SOMCalloc, SOMMalloc, SOMRealloc
Methods: somFree
Komentarze do niniejszej Instrukcji