PURPOSE

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, made non-fielded, and then freed.

Ffree() is recommended as opposed to free(3) (in UNIX System reference manuals), because Ffree() invalidates a fielded buffer whereas free(3) does not. It is important to invalidate fielded buffers because malloc(3) (in UNIX System reference manuals) re-uses memory that has been freed without clearing it. Thus, if free(3) 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.

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

Fintro(3fml),
Falloc(3fml),
Frealloc(3fml)
free(3), malloc(3) in a UNIX System reference manual