Jump to content

SomDeallocate: Difference between revisions

From EDM2
Created page with "{{DISPLAYTITLE:somDeallocate}} This method frees memory originally allocated by the somAllocate method from the same class object. It cannot be overridden. For backward compa..."
 
Ak120 (talk | contribs)
mNo edit summary
 
Line 4: Line 4:
For backward compatibility, this method does not take an Environment parameter.
For backward compatibility, this method does not take an Environment parameter.


; Original Class : [[SOMClass]]
;Original Class : [[SOMClass]]
 
==Syntax==
==Syntax==
  void somDeallocate (SOMClass receiver, string memPtr)
  void somDeallocate (SOMClass receiver, string memPtr)


==Parameters==
==Parameters==
; receiver (SOMClass) : A pointer to the class object whose somAllocate was originally used to allocate the memory now to be freed.  
;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.
; memPtr (string) : A pointer to the first byte of the region of memory that is to be freed.


==Return Code==
==Return Code==
Line 22: Line 22:


==Related==
==Related==
===Methods===
;Methods
* [[somAllocate]]
* [[somAllocate]]


[[Category:SOMClass]]
[[Category:SOMClass]]

Latest revision as of 18:37, 12 October 2022

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