![]() |
![]() |
|
|
Freeing a Typed Buffer
The tpfree(3c) function frees a buffer allocated by tpalloc() or reallocated by tprealloc(). The tpfree() function signature is as follows.
void
tpfree(char *ptr)
The tpfree() function takes only one argument, ptr, which is described in the following table.
tpfree() Function Argument
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() routine. When ptr is NULL, no action occurs.
The following example shows how to use the tpfree() function to free a buffer.
Freeing a Buffer
struct aud *audv; /* pointer to aud view structure */
. . .
audv = (struct aud *)tpalloc("VIEW", "aud", sizeof(struct aud));
. . .
tpfree((char *)audv);
See Also
![]() |
![]() |
![]() |
|
Copyright © 2000 BEA Systems, Inc. All rights reserved.
|