TutFree


Name

TutFree — free the previously allocated memory block

Synopsis

void TutFree(ptr) 
T_PTR ptr; 

Arguments

ptr — pointer to the memory block to be freed

Return Values

None

Diagnostics

None

Description

TutFree frees the previously allocated block of memory. Using this function in the code ensures portability to all the platforms that SmartSockets currently supports.

All SmartSockets memory management uses the functions TutCalloc, TutFree, TutMalloc, and TutRealloc. You can set debugger breakpoints in these functions to trace SmartSockets memory usage.

Caution

TutCalloc, TutFree, TutMalloc, and TutRealloc are not compatible with other memory management functions. Memory allocated by SmartSockets (including memory allocated by TutCalloc, TutMalloc, or TutRealloc) must be reallocated with TutRealloc and freed with TutFree. Attempting to mix memory management functions will result in unpredictable and potentially unstable behavior.

See Also

TutCalloc, TutMalloc, TutRealloc

Examples

This example allocates and frees a string 30 characters long:

T_STR strptr; 
 
/* the string has to be 30 characters long, so one space has to be */ 
/* reserved for the terminating NULL */ 
strptr = (T_STR)TutCalloc(31); 
... 
TutFree(strptr); 
 

TIBCO SmartSockets™ Utilities
Software Release 6.8, July 2006
Copyright © TIBCO Software Inc. All rights reserved
www.tibco.com