CKALLOC

Section: C Library Functions (3)
Index Return to Main Contents
 

NAME

ckalloc - allocate memory safely  

SYNOPSIS

void *ckalloc(size)
unsigned int size;

#include <funclist.h>
extern FUNCLIST *OutOfMemoryFuncs;  

DESCRIPTION

ckalloc allocates memory from the heap in the same manner as malloc(3). However, if sufficient memory is unavailable, recovery is attempted by calling the list of functions indicated by the OutOfMemoryFuncs global function list (see funclist(3) for details). After these functions are called, the allocation is retried.

If the second attempt fails, ckalloc immediately terminates the process with a message using syserr(3).  

SEE ALSO

malloc(3), funclist(3), syserr(3)  

AUTHOR

Eric Allman, University of California, Berkeley


 

Index

NAME
SYNOPSIS
DESCRIPTION
SEE ALSO
AUTHOR

This document was created by man2html, using the manual pages.
Time: 21:53:14 GMT, February 02, 2023