Main Page   Namespace List   Class Hierarchy   Compound List   File List   Namespace Members   Compound Members   File Members  

xalloc.h File Reference

This graph shows which files directly or indirectly include this file:

Included by dependency graph

Go to the source code of this file.

Defines

#define PARAMS(Args)   ()
#define __attribute__(x)
#define ATTRIBUTE_NORETURN   __attribute__ ((__noreturn__))
#define XMALLOC(Type, N_items)   ((Type *) xmalloc (sizeof (Type) * (N_items)))
#define XCALLOC(Type, N_items)   ((Type *) xcalloc (sizeof (Type), (N_items)))
#define XREALLOC(Ptr, Type, N_items)   ((Type *) xrealloc ((void *) (Ptr), sizeof (Type) * (N_items)))
#define NEW(Type, Var)   Type *(Var) = XMALLOC (Type, 1)
#define XFREE(Var)
#define CCLONE(Src, Num)   (memcpy (xmalloc (sizeof (*Src) * (Num)), (Src), sizeof (*Src) * (Num)))
#define CLONE(Src)   CCLONE (Src, 1)

Functions

void xalloc_fail_func PARAMS ((void))
void *xmalloc PARAMS ((size_t n))
void *xcalloc PARAMS ((size_t n, size_t s))
void *xrealloc PARAMS ((void *p, size_t n))
char *xstrdup PARAMS ((const char *str))

Variables

int xalloc_exit_failure
char const xalloc_msg_memory_exhausted []


Define Documentation

#define PARAMS Args       ()
 

#define __attribute__  
 

#define ATTRIBUTE_NORETURN   __attribute__ ((__noreturn__))
 

#define XMALLOC Type,
N_items       ((Type *) xmalloc (sizeof (Type) * (N_items)))
 

#define XCALLOC Type,
N_items       ((Type *) xcalloc (sizeof (Type), (N_items)))
 

#define XREALLOC Ptr,
Type,
N_items       ((Type *) xrealloc ((void *) (Ptr), sizeof (Type) * (N_items)))
 

#define NEW Type,
Var       Type *(Var) = XMALLOC (Type, 1)
 

#define XFREE Var   
 

Value:

do {                 \
      if (Var)          \
        free (Var);     \
   } while (0)

#define CCLONE Src,
Num       (memcpy (xmalloc (sizeof (*Src) * (Num)), (Src), sizeof (*Src) * (Num)))
 

#define CLONE Src       CCLONE (Src, 1)
 


Function Documentation

void xalloc_fail_func PARAMS (void)   
 

void* xmalloc PARAMS (size_t n)   
 

void* xcalloc PARAMS (size_t n, size_t s)   
 

void* xrealloc PARAMS (void *p, size_t n)   
 

char* xstrdup PARAMS (const char *str)   
 


Variable Documentation

int xalloc_exit_failure
 

char const xalloc_msg_memory_exhausted[]
 


Generated on Mon Apr 7 19:42:58 2003 for DuTree by doxygen1.2.18