BEA Logo BEA Tuxedo Release 7.1

  Corporate Info  |  News  |  Solutions  |  Products  |  Partners  |  Services  |  Events  |  Download  |  How To Buy

 

   Tuxedo Doc Home   |   Reference   |   Topic List   |   Previous   |   Next   |   Contents

   BEA Tuxedo C Function Reference

tpfree(3c)

Name

tpfree() - routine for freeing a typed buffer

Synopsis

#include <atmi.h> 
void tpfree(char *ptr)

Description

The argument to tpfree() is a pointer to a buffer previously obtained by either tpalloc() or tprealloc(). If ptr is NULL, no action occurs. Undefined results will occur if ptr does not point to a typed buffer (or if it points to space previously freed with tpfree()). Inside service routines, tpfree() returns and does not free the buffer if ptr points to the buffer passed into a service routine.

Some buffer types require state information or associated data to be removed as part of freeing a buffer. tpfree() removes any of these associations (in a communication manager-specific manner) before a buffer is freed.

Once tpfree() returns, ptr should not be passed as an argument to any BEA Tuxedo system routine or used in any other manner.

A thread in a multithreaded application may issue a call to tpfree() while running in any context state, including TPINVALIDCONTEXT.

When freeing an FML32 buffer using tpfree(), the routine recursively frees all embedded buffers to prevent memory leaks. In order to preserve the embedded buffers, you should assign the associated pointer to NULL before issuing the tpfree() command. As stated above, if ptr is NULL, no action occurs.

Return Values

tpfree() does not return any value to its caller. Thus, it is declared as a void.

Usage

This function should not be used in concert with malloc(), realloc(), or free() in the C library (for example, a buffer allocated with tpalloc() should not be freed with free()).

See Also

Introduction to the C Language Application-Transaction Monitor Interface, tpalloc(3c), tprealloc(3c)