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 FML Function Reference

Ffree, Ffree32(3fml)

Name

Ffree(), Ffree32() - free space allocated for fielded buffer

Synopsis

#include <stdio.h> 
#include "fml.h"
int
Ffree(FBFR *fbfr)
#include "fml32.h"
int
Ffree32(FBFR32 *fbfr)

Description

Ffree() is used to recover space allocated to its argument fielded buffer. fbfr is a pointer to a fielded buffer. The fielded buffer is invalidated, that is, it is made non-fielded, and then freed. Ffree32() does not free the memory area referenced by a pointer in a FLD_PTR field.

Ffree() is recommended as opposed to free() (in UNIX System reference manuals), because Ffree()invalidates a fielded buffer whereas free() does not. It is important to invalidate fielded buffers because malloc() (in UNIX System reference manuals) re-uses memory that has been freed without clearing it. Thus, if free() were used, it would be possible for malloc() to return a piece of memory that looks like a valid fielded buffer but is not.

Ffree32() is used with 32-bit FML.

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

Return Values

This function returns -1 on error and sets Ferror to indicate the error condition.

Errors

Under the following conditions, Ffree() fails and sets Ferror to:

[FALIGNERR]

"fielded buffer not aligned" The buffer does not begin on the proper boundary.

[FNOTFLD]

"buffer not fielded" The buffer is not a fielded buffer or has not been initialized by Finit().

See Also

Introduction to FML Functions, Falloc, Falloc32(3fml), Frealloc, Frealloc32(3fml)

free(3), malloc(3) in a UNIX system reference manual