Important: The information in this document is obsolete and should not be used for new development.
OTFree
Frees memory allocated using theOTAllocfunction.C INTERFACE
OSResult OTFree(void* ptr, OTStructType structType);C++ INTERFACE
OSResult TEndpoint::Free(void* ptr, OTStructType structType);PARAMETERS
ptr- A pointer to the structure to be deallocated. This is the pointer returned by the
OTAllocfunction.structType- The name of the structure for which you allocated memory using the
OTAllocfunction. Possible constant names are given by the structure types enumeration.- function result
- An error code. See Appendix B.
DISCUSSION
You are responsible for passing astructTypeparameter that exactly matches the type of structure being freed.The
OTFreefunction, along with theOTAllocfunction, is provided mainly for compatibility with XTI. TheOTAllocfunction allocates the memoryOTFreedeallocates.
- WARNING
- In order to use the
OTFreefunction, you must not have changed the memory allocated by theOTAllocfunction for the structure specified by thestructTypeparameter. If you have changed these, you must restore them to their original value before callingOTFree.![]()
SPECIAL CONSIDERATIONS
Although this function is defined to return anOTResult, there are no meaningful positive results. You either getkOTNoError, or a negative error code.SEE ALSO
TheOTAllocfunction.The
OTAllocMemfunction and theOTFreeMemfunction.