Go to the documentation of this file.
2#if !defined(__DSDP_MEM_H)
13extern int DSDPMMalloc(
const char*,
size_t,
void**);
14extern int DSDPFFree(
void**);
24#define DSDPCALLOC1(VAR,TYPE,MERR) { \
25 *(VAR) = (TYPE*)mxMalloc(sizeof(TYPE)); \
27 if ( *(VAR)==0){*(MERR)=1;} \
28 else {memset(*(VAR),0,sizeof(TYPE));} }
30#define DSDPCALLOC2(VAR,TYPE,SIZE,MERR) { \
34 *(VAR) = (TYPE*)mxMalloc((SIZE)*sizeof(TYPE)); \
35 if (*(VAR)==0){ *(MERR)=1;} \
36 else {memset(*(VAR),0,(SIZE)*sizeof(TYPE));} \
40#define DSDPFREE(VAR,MERR) {if (*(VAR)){mxFree(*(VAR));}*(VAR)=0;*(MERR)=0;}
58#define DSDPCALLOC1(VAR,TYPE,MERR) { \
59 *(VAR) = (TYPE*)calloc(1, sizeof(TYPE)); \
61 if ( *(VAR)==0){*(MERR)=1;} \
62 else { memset(*(VAR),0,sizeof(TYPE)); } \
67#define DSDPCALLOC2(VAR,TYPE,SIZE,MERR) { \
71 *(VAR) = (TYPE*)calloc(SIZE, sizeof(TYPE)); \
72 if (*(VAR)==0){ *(MERR)=1;} \
73 else { memset(*(VAR),0,(SIZE)*sizeof(TYPE)); } \
79#define DSDPFREE(VAR,MERR) {if (*(VAR)){free(*(VAR));}*(VAR)=0;*(MERR)=0;}