xmalloc.c File Reference

Memory allocation routines - Makes the program die "nicely" if request for more memory fails. More...

Go to the source code of this file.

Functions

void * xmalloc (int n)
void * xcalloc (long count, long nbytes)
char * xstrdup (const char *s)
void * xresize (void *p, long nbytes)


Detailed Description

Memory allocation routines - Makes the program die "nicely" if request for more memory fails.

Copied from the fetchmail code, extended and massaged a bit to suite the monit code and coding style.

Author:
Eric S. Raymond <esr@snark.thyrsus.com> , Jan-Henrik Haukeland, <hauk@tildeslash.com>
Version:
$Id: xmalloc.c,v 1.5 2002/12/21 13:56:04 hauk Exp $

Definition in file xmalloc.c.


Function Documentation

void* xcalloc long    count,
long    nbytes
 

Definition at line 81 of file xmalloc.c.

References error(), prog, and STRERROR.

void* xmalloc int    n
 

Definition at line 52 of file xmalloc.c.

References error(), prog, and STRERROR.

Referenced by decode_base64(), encode_base64(), find_rcfile(), format(), get_basic_authentication_header(), get_ctime(), makeword(), out_print(), url_encode(), xresize(), and xstrdup().

void* xresize void *    p,
long    nbytes
 

Definition at line 112 of file xmalloc.c.

References error(), prog, STRERROR, and xmalloc().

Referenced by format(), and out_print().

char* xstrdup const char *    s
 

Definition at line 98 of file xmalloc.c.

References ASSERT, and xmalloc().

Referenced by add_host_allow(), get_basic_authentication_header(), get_header(), get_headers(), get_md5sum(), get_parameter(), get_process_uptime(), get_RFC1123date(), get_status_string(), get_uptime(), init_files(), insert_accepted_ssl_socket(), new_ssl_connection(), new_ssl_server_connection(), set_header(), set_status(), and update_ssl_cert_data().