Back to index

lightning-sunbird  0.9+nobinonly
Functions
xmalloc.c File Reference
#include <stdio.h>
#include <stdlib.h>
#include "xmalloc.h"

Go to the source code of this file.

Functions

voidxmalloc (size_t size)
voidxcalloc (size_t nmemb, size_t size)

Function Documentation

void* xcalloc ( size_t  nmemb,
size_t  size 
)

Definition at line 46 of file xmalloc.c.

{
    void *buf;

    buf = calloc (nmemb, size);
    if (!buf) {
       fprintf (stderr, "Error: Out of memory. Exiting\n");
       exit (1);
    }

    return buf;
}

Here is the call graph for this function:

Here is the caller graph for this function:

void* xmalloc ( size_t  size)

Definition at line 32 of file xmalloc.c.

{
    void *buf;

    buf = malloc (size);
    if (!buf) {
       fprintf (stderr, "Error: Out of memory. Exiting.\n");
       exit (1);
    }

    return buf;
}

Here is the call graph for this function: