SOMFree: Difference between revisions
Appearance
Created page with "==Description== This instance method is called to allow the object to add the View 1 page to its Settings notebook. ==Syntax== <PRE> #define INCL_WINWORKPLACE #include <os2...." |
|||
(6 intermediate revisions by 2 users not shown) | |||
Line 1: | Line 1: | ||
{{DISPLAYTITLE:somFree}} | |||
This | This function frees the specified block of memory. | ||
==Syntax== | ==Syntax== | ||
<PRE> | <PRE> | ||
void (*somFree) (somToken ptr) | |||
</PRE> | |||
==Parameters== | ==Parameters== | ||
; | ; ptr (somToken): A pointer to the block of storage to be freed. | ||
==Return Code== | ==Return Code== | ||
rc ( | rc (void) | ||
==Remarks== | ==Remarks== | ||
Line 35: | Line 19: | ||
==Example Code== | ==Example Code== | ||
<PRE> | <PRE> | ||
#include <som.h> | #include <som.h> | ||
Line 54: | Line 37: | ||
* [[somFree]] | * [[somFree]] | ||
[[Category:SOM Kernel]] | [[Category:SOM Kernel]] |
Latest revision as of 04:06, 18 October 2017
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); }