00001
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029 #ifndef XMEMORY_H
00030 #define XMEMORY_H
00031
00032
00033
00034
00035
00036 #include <stdio.h>
00037 #include <stdlib.h>
00038 #include <string.h>
00039
00040
00041
00042
00043
00044
00045 #define _XMEMORY_ 1
00046
00047
00048
00049
00050
00051
00052 #ifdef strdup
00053 #undef strdup
00054 #endif
00055
00056 #define malloc(s) xmemory_malloc(s, __FILE__,__LINE__)
00057 #define calloc(n,s) xmemory_calloc(n,s, __FILE__,__LINE__)
00058 #define realloc(p,s) xmemory_realloc(p,s, __FILE__,__LINE__)
00059 #define free(p) xmemory_free(p, __FILE__,__LINE__)
00060 #define strdup(s) xmemory_strdup(s, __FILE__,__LINE__)
00061 #define falloc(f,o,s) xmemory_falloc(f,o,s, __FILE__,__LINE__)
00062
00063
00064 #define xmemory_status() xmemory_status_(__FILE__,__LINE__)
00065 #define xmemory_diagnostics() xmemory_status_(__FILE__,__LINE__)
00066
00067
00068
00069
00070
00071 void * xmemory_malloc(size_t, char *, int) ;
00072 void * xmemory_calloc(size_t, size_t, char *, int) ;
00073 void * xmemory_realloc(void *, size_t, char *, int) ;
00074 void xmemory_free(void *, char *, int) ;
00075 char * xmemory_strdup(char *, char *, int) ;
00076 char * xmemory_falloc(char *, size_t, size_t *, char *, int) ;
00077
00078 void xmemory_on(void) ;
00079 void xmemory_off(void) ;
00080 void xmemory_status_(char * filename, int lineno) ;
00081 void xmemory_settmpdir(char * dirname) ;
00082 char * xmemory_gettmpdir(void);
00083
00084 #endif
00085