Important: The information in this document is obsolete and should not be used for new development.
OTFree
Frees memory allocated using theOTAlloc
function.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
OTAlloc
function.structType
- The name of the structure for which you allocated memory using the
OTAlloc
function. Possible constant names are given by the structure types enumeration.
- function result
- An error code. See Appendix B.
DISCUSSION
You are responsible for passing astructType
parameter that exactly matches the type of structure being freed.The
OTFree
function, along with theOTAlloc
function, is provided mainly for compatibility with XTI. TheOTAlloc
function allocates the memoryOTFree
deallocates.
- WARNING
- In order to use the
OTFree
function, you must not have changed the memory allocated by theOTAlloc
function for the structure specified by thestructType
parameter. 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
TheOTAlloc
function.The
OTAllocMem
function and theOTFreeMem
function.