abyss_mallocvar.h File Reference

#include <xmlrpc-c/config.h>
#include <limits.h>
#include <stdlib.h>

Include dependency graph for abyss_mallocvar.h:

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

Go to the source code of this file.

Defines

#define MALLOCARRAY(arrayName, nElements)
#define MALLOCARRAY_NOFAIL(arrayName, nElements)
#define MALLOCVAR(varName)   varName = malloc(sizeof(*varName))
#define MALLOCVAR_NOFAIL(varName)   do {if ((varName = malloc(sizeof(*varName))) == NULL) abort();} while(0)
#define REALLOCARRAY(arrayName, nElements)
#define REALLOCARRAY_NOFAIL(arrayName, nElements)

Functions

static __inline__ void mallocProduct (void **const resultP, unsigned int const factor1, unsigned int const factor2)
static __inline__ void reallocProduct (void **const blockP, unsigned int const factor1, unsigned int const factor2)


Define Documentation

#define MALLOCARRAY ( arrayName,
nElements   ) 

Value:

do { \
    void * array; \
    mallocProduct(&array, nElements, sizeof(arrayName[0])); \
    arrayName = array; \
} while (0)

Definition at line 65 of file abyss_mallocvar.h.

Referenced by PoolZoneAlloc().

#define MALLOCARRAY_NOFAIL ( arrayName,
nElements   ) 

Value:

do { \
    MALLOCARRAY(arrayName, nElements); \
    if ((arrayName) == NULL) \
        abort(); \
} while(0)

Definition at line 78 of file abyss_mallocvar.h.

#define MALLOCVAR ( varName   )     varName = malloc(sizeof(*varName))

#define MALLOCVAR_NOFAIL ( varName   )     do {if ((varName = malloc(sizeof(*varName))) == NULL) abort();} while(0)

Definition at line 96 of file abyss_mallocvar.h.

Referenced by createOutstandingConnList(), and setHandler().

#define REALLOCARRAY ( arrayName,
nElements   ) 

Value:

{ \
    void * array = arrayName; \
    reallocProduct(&array, nElements, sizeof(arrayName[0])); \
    arrayName = array; \
} while (0)

Definition at line 71 of file abyss_mallocvar.h.

#define REALLOCARRAY_NOFAIL ( arrayName,
nElements   ) 

Value:

do { \
    REALLOCARRAY(arrayName, nElements); \
    if ((arrayName) == NULL) \
        abort(); \
} while(0)

Definition at line 85 of file abyss_mallocvar.h.


Function Documentation

static __inline__ void mallocProduct ( void **const   resultP,
unsigned int const   factor1,
unsigned int const   factor2 
) [static]

Definition at line 19 of file abyss_mallocvar.h.

References NULL.

static __inline__ void reallocProduct ( void **const   blockP,
unsigned int const   factor1,
unsigned int const   factor2 
) [static]

Definition at line 50 of file abyss_mallocvar.h.

References NULL.


Generated on Thu May 17 10:00:33 2012 for Kamailio - The Open Source SIP Server by  doxygen 1.5.6