Jump to content

SOMFree: Difference between revisions

From EDM2
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...."
 
m Martini moved page SomFree to SOMFree without leaving a redirect
 
(6 intermediate revisions by 2 users not shown)
Line 1: Line 1:
==Description==
{{DISPLAYTITLE:somFree}}
This instance method is called to allow the object to add the View 1 page to its Settings notebook.  
This function frees the specified block of memory.


==Syntax==
==Syntax==
<PRE>
<PRE>
#define INCL_WINWORKPLACE
void (*somFree) (somToken ptr)
#include <os2.h>
</PRE>


WPClock    *somSelf;      /*  Pointer to the object on which the method is being invoked. */
HWND        hwndNotebook;  /*  Settings notebook handle. */
ULONG        rc;            /*  Page identifier. */
rc = _wpAddClockView1Page(somSelf, hwndNotebook);
</PRE>
==Parameters==
==Parameters==
; somSelf (WPClock *) - input : Pointer to the object on which the method is being invoked.
; ptr (somToken): A pointer to the block of storage to be freed.
 
Points to an object of class WPClock.
 
; hwndNotebook (HWND) - input : Settings notebook handle.
 


==Return Code==
==Return Code==
rc (ULONG) - returns
rc (void)
 
* Page identifier.
* Error occurred
; PageId : Identifier for the inserted page.
 


==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:The OS/2 API Project]]
[[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);
}

Related

Functions

Methods