SimGrid  3.13
Versatile Simulation of Distributed Systems
Malloc and friends

Malloc and associated functions, killing the program on error (with Exception support) More...

Macros

#define xbt_free(p)
 like free More...
 
#define xbt_new(type, count)   ((type*)xbt_malloc (sizeof (type) * (count)))
 
#define xbt_new0(type, count)
 like calloc, but xbt_die() on error More...
 

Functions

static XBT_ALWAYS_INLINE char * xbt_strdup (const char *s)
 Like strdup, but xbt_die() on error. More...
 
void xbt_backtrace_display_current (void)
 show the backtrace of the current point (lovely while debuging) More...
 
static XBT_ALWAYS_INLINE voidxbt_malloc (size_t n)
 Like malloc, but xbt_die() on error. More...
 
static XBT_ALWAYS_INLINE voidxbt_malloc0 (size_t n)
 like malloc, but xbt_die() on error and memset data to 0 More...
 
static XBT_ALWAYS_INLINE voidxbt_realloc (void *p, size_t s)
 like realloc, but xbt_die() on error More...
 
void xbt_free_f (void *p)
 like free, but you can be sure that it is a function More...
 
void xbt_free_ref (void *d)
 should be given a pointer to pointer, and frees the second one More...
 

Detailed Description

Malloc and associated functions, killing the program on error (with Exception support)

Macro Definition Documentation

#define xbt_free (   p)

like free

#define xbt_new (   type,
  count 
)    ((type*)xbt_malloc (sizeof (type) * (count)))
#define xbt_new0 (   type,
  count 
)

like calloc, but xbt_die() on error

Function Documentation

static XBT_ALWAYS_INLINE char* xbt_strdup ( const char *  s)
static

Like strdup, but xbt_die() on error.

void xbt_backtrace_display_current ( void  )

show the backtrace of the current point (lovely while debuging)

Shows a backtrace of the current location.

static XBT_ALWAYS_INLINE void* xbt_malloc ( size_t  n)
static

Like malloc, but xbt_die() on error.

static XBT_ALWAYS_INLINE void* xbt_malloc0 ( size_t  n)
static

like malloc, but xbt_die() on error and memset data to 0

static XBT_ALWAYS_INLINE void* xbt_realloc ( void p,
size_t  s 
)
static

like realloc, but xbt_die() on error

void xbt_free_f ( void p)

like free, but you can be sure that it is a function

void xbt_free_ref ( void d)

should be given a pointer to pointer, and frees the second one