00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014 #ifndef _MEMALLOC_H
00015 #define _MEMALLOC_H
00016
00017 #include <stdlib.h>
00018
00019 #define utl_ivecalloc(n) (int *) utl_calloc(n, sizeof(int))
00020 #define utl_dvecalloc(n) (double *) utl_calloc(n, sizeof(double))
00021 #define utl_calloc(n,s) fem_calloc(n,s,__FILE__,__LINE__)
00022 #define utl_realloc(a,s) fem_realloc(a,s,__FILE__,__LINE__,#a)
00023 #define utl_imatalloc(nr,nc) fem_imatalloc(nr,nc,__FILE__,__LINE__)
00024 #define utl_cmatalloc(nr,nc) fem_cmatalloc(nr,nc,__FILE__,__LINE__)
00025 #define utl_dmatalloc(nr,nc) fem_dmatalloc(nr,nc,__FILE__,__LINE__)
00026 #define utl_profilealloc(nr,p) fem_profilealloc(nr,p,__FILE__,__LINE__)
00027
00028 #define utl_free(a) fem_free(a,__FILE__,__LINE__,#a)
00029 #define utl_imatfree(m,nr) fem_imatfree(m,nr,__FILE__,__LINE__,#m)
00030 #define utl_cmatfree(m,nr) fem_cmatfree(m,nr,__FILE__,__LINE__,#m)
00031 #define utl_dmatfree(m,nr) fem_dmatfree(m,nr,__FILE__,__LINE__,#m)
00032 #define utl_profilefree(m,nr,p) fem_profilefree(m,nr,p,__FILE__,__LINE__,#m)
00033
00034 void *fem_realloc ( void *, int, char *, int, char * );
00035 void *fem_calloc ( int, int, char *, int );
00036 int **fem_imatalloc ( int, int, char *, int );
00037 char **fem_cmatalloc ( int, int, char *, int );
00038 double **fem_dmatalloc ( int, int, char *, int );
00039 double **fem_profilealloc( int, int *, char *, int );
00040
00041 void fem_free ( void *, char *, int, char * );
00042 void fem_imatfree ( int **, int, char *, int, char * );
00043 void fem_cmatfree ( char **, int, char *, int, char * );
00044 void fem_dmatfree ( double **, int, char *, int, char * );
00045 void fem_profilefree ( double **, int, int *, char *, int, char * );
00046
00047 #endif