Back to index

tetex-bin  3.0
Functions
xmalloc.c File Reference
#include "system.h"

Go to the source code of this file.

Functions

static void memory_error_and_abort (const char *fname)
voidxmalloc (size_t bytes)
voidxrealloc (void *pointer, size_t bytes)

Function Documentation

static void memory_error_and_abort ( const char *  fname) [static]

Definition at line 26 of file xmalloc.c.

{
  fprintf (stderr, "%s: Out of virtual memory!\n", fname);
  abort ();
}

Here is the call graph for this function:

Here is the caller graph for this function:

void* xmalloc ( size_t  bytes)

Definition at line 36 of file xmalloc.c.

{
  void *temp = malloc (bytes);

  if (!temp)
    memory_error_and_abort ("xmalloc");
  return (temp);
}

Here is the call graph for this function:

void* xrealloc ( void pointer,
size_t  bytes 
)

Definition at line 46 of file xmalloc.c.

{
  void *temp;

  if (!pointer)
    temp = malloc (bytes);
  else
    temp = realloc (pointer, bytes);

  if (!temp)
    memory_error_and_abort ("xrealloc");

  return (temp);
}

Here is the call graph for this function: