bsp_alloc.h File Reference

provides wrapper functions for malloc(), calloc() and free(). More...

#include <config.h>
#include <stdlib.h>
#include "bsp_abort.h"

Include dependency graph for bsp_alloc.h:

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

Go to the source code of this file.

Defines

#define bsp_malloc(n, sz)
 wrapper macro for bsp_mallocx()
#define bsp_calloc(n, sz)
 wrapper macro bsp_callocx()

Functions

static void * bsp_mallocx (const size_t n, const size_t sz, const char *func, const char *file, int line)
 allocates memory.
static void * bsp_callocx (const size_t n, const size_t sz, const char *func, const char *file, int line)
 allocates cleared (zeroed) memory.
static void bsp_free (void *ptr)
 frees memory.


Detailed Description

provides wrapper functions for malloc(), calloc() and free().

Author:
Wijnand Suijlen

Definition in file bsp_alloc.h.


Define Documentation

#define bsp_calloc n,
sz   ) 
 

Value:

bsp_callocx((n), (sz), \
                          __func__, __FILE__, __LINE__ )
wrapper macro bsp_callocx()

Definition at line 44 of file bsp_alloc.h.

Referenced by expandableTable_initialize(), memoryRegister_expand(), memoryRegister_initialize(), newMemRegInfoAtPush(), and requestTable_initialize().

#define bsp_malloc n,
sz   ) 
 

Value:

bsp_mallocx((n), (sz), \
                          __func__, __FILE__, __LINE__ )
wrapper macro for bsp_mallocx()

Definition at line 40 of file bsp_alloc.h.

Referenced by bsp_begin(), deliveryTable_initialize(), expandableTable_expand(), and expandableTable_initialize().


Function Documentation

static void* bsp_callocx const size_t  n,
const size_t  sz,
const char *  func,
const char *  file,
int  line
[inline, static]
 

allocates cleared (zeroed) memory.

Parameters:
n number of elements to be allocated
sz size of one element
func Function from where this function is called
file File from where this function is calles
line line number from where this function is called
Returns:
a pointer to a memory location big enough to contain the data or NULL when a region of size 0 is requested

Definition at line 83 of file bsp_alloc.h.

References bsp_intern_abort(), and ERR_NOT_ENOUGH_MEMORY.

Here is the call graph for this function:

static void bsp_free void *  ptr  )  [inline, static]
 

frees memory.

Parameters:
ptr A pointer created by a bsp_malloc() or a bsp_calloc()

Definition at line 102 of file bsp_alloc.h.

Referenced by bsp_begin(), deliveryTable_destruct(), expandableTable_destruct(), expandableTable_expand(), memoryRegister_destruct(), memoryRegister_expand(), newMemRegInfoAtPush(), and requestTable_destruct().

static void* bsp_mallocx const size_t  n,
const size_t  sz,
const char *  func,
const char *  file,
int  line
[inline, static]
 

allocates memory.

Note:
Use the macro's bsp_malloc() and bsp_calloc() instead
Parameters:
n number of elements to be allocated
sz size of one element
func Function from where this function is called
file File from where this function is calles
line line number from where this function is called
Returns:
a pointer to a memory location big enough to contain the data or NULL when a region of size 0 is requested

Definition at line 58 of file bsp_alloc.h.

References bsp_intern_abort(), and ERR_NOT_ENOUGH_MEMORY.

Here is the call graph for this function:


Generated on Sat Apr 8 20:13:10 2006 for BSPonMPI by  doxygen 1.4.6