somDeallocate

From EDM2
Jump to: navigation, search

This method frees memory originally allocated by the somAllocate method from the same class object. It cannot be overridden.

For backward compatibility, this method does not take an Environment parameter.

Original Class 
SOMClass

Syntax

void somDeallocate (SOMClass receiver, string memPtr)

Parameters

receiver (SOMClass) 
A pointer to the class object whose somAllocate was originally used to allocate the memory now to be freed.
memPtr (string) 
A pointer to the first byte of the region of memory that is to be freed.

Return Code

rc (void)

Remarks

The somDeallocate method is intended for use to free memory allocated using its dual method, somAllocate. When building a class, the somBuildClass function is responsible for registering the procedure that will be executed when this method is invoked on the class. The default procedure regisistered by somBuildClass uses the SOMFree function, but the IDL modifier somdeallocate can be used in the SOM IDL class implementation section to indicate a different procedure. Users of this method should be sure that the dual method, somAllocate, was originally used to allocate storage. Also, if the IDL modifier somdeallocate is used to indicate a special deallocation routine, the IDL modifier somallocate should be used to indicate a dual procedure to be called when somAllocate is invoked.

Example Code

Related

Methods