ATMI C Function Reference
tpfree()
—Routine for freeing a typed buffer.
#include <atmi.h>
void tpfree(char *ptr)
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 ATMI 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.
tpfree()
does not return any value to its caller. Thus, it is declared as a void.
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()
).
Introduction to the C Language Application-to-Transaction Monitor Interface, tpalloc(3c)
, tprealloc(3c)