OpenTP1 Version 7 Programming Reference C Language
Format
ANSI C, C++
#include <xatmi.h> void tpfree (char *ptr) |
K&R C
#include <xatmi.h> void tpfree (ptr) 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 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-resource-manager-specific manner) before a buffer is freed.
Once tpfree() returns, ptr should not be passed as an argument to any XATMI routine or used in any other manner.
<<Argument>>
<<ptr
Specify the pointer to the buffer allocated by the function tpalloc() or tprealloc().>>
Return value
The function tpfree() does not return any value to its caller. Therefore, it is declared as a void.
Application 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
tpalloc(), tprealloc().
<<Notes on use with OpenTP1>>
All Rights Reserved. Copyright (C) 2006, 2010, Hitachi, Ltd.