HP C/iX Library Reference Manual (30026-90004)

Chapter 5 243
HP C/iX Library Function Descriptions
mallinfo
mallinfo
Returns information describing space usage.
Syntax
#include <malloc.h>
struct mallinfo mallinfo (void);
Parameters
None.
Return Values
x A pointer to an object of type struct mallinfo.
Description
The mallinfo function provides instrumentation describing space usage, but may not be
called until the first small block is allocated.
It returns the following structure:
struct mallinfo {
int arena; /* total space in arena */
int ordblks; /* number of ordinary blocks */
int smblks; /* number of small blocks */
int hblkhd; /* space in holding block headers */
int hblks; /* number of holding blocks */
int usmblks; /* space in small blocks in use */
int fsmblks; /* space in free small blocks */
int uordblks; /* space in ordinary blocks in use */
int fordblks; /* space in free ordinary blocks */
int keepcost; /* space penalty if keep option */
/* is used */
}
This structure is defined in the <malloc.h> header file.
NOTE
The header <malloc.h> and the mallopt() and mallinfo() functions are
not ANSI C and should be avoided if portability is a consideration.
See Also
malloc(), calloc(), mallopt(), realloc()