Legacy Documentclose button

Important: The information in this document is obsolete and should not be used for new development.

Previous Book Contents Book Index Next

Inside Macintosh: Networking With Open Transport / Part 2 - Open Transport Reference
Chapter 22 - Endpoints Reference / Functions
Allocating Structures /


OTFree

Frees memory allocated using the OTAlloc 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 a structType parameter that exactly matches the type of structure being freed.

The OTFree function, along with the OTAlloc function, is provided mainly for compatibility with XTI. The OTAlloc function allocates the memory OTFree deallocates.

WARNING
In order to use the OTFree function, you must not have changed the memory allocated by the OTAlloc function for the structure specified by the structType parameter. If you have changed these, you must restore them to their original value before calling OTFree.
SPECIAL CONSIDERATIONS
Although this function is defined to return an OTResult, there are no meaningful positive results. You either get kOTNoError, or a negative error code.

SEE ALSO
The OTAlloc function.

The OTAllocMem function and the OTFreeMem function.

Table 4-4.


Previous Book Contents Book Index Next

© Apple Computer, Inc.
15 JAN 1998