include/nmxp_memory.h

Go to the documentation of this file.
00001 
00014 #ifndef NMXP_MEMORY_H
00015 #define NMXP_MEMORY_H 1
00016 
00017 #ifndef NMXP_MEM_DEBUG
00018 
00019 #define NMXP_MEM_MALLOC(size) malloc(size)
00020 #define NMXP_MEM_STRDUP(str) strdup(str)
00021 #define NMXP_MEM_FREE(ptr) free(ptr)
00022 #define NMXP_MEM_PRINT_PTR(print_items) nmxp_mem_null_function()
00023 
00024 
00031 inline int nmxp_mem_null_function();
00032 
00033 #else
00034 
00035 #define NMXP_MEM_MALLOC(size) nmxp_mem_malloc(size, __FILE__, __LINE__)
00036 #define NMXP_MEM_STRDUP(str) nmxp_mem_strdup(str, __FILE__, __LINE__)
00037 #define NMXP_MEM_FREE(ptr) nmxp_mem_free(ptr, __FILE__, __LINE__)
00038 #define NMXP_MEM_PRINT_PTR(print_items) nmxp_mem_print_ptr(print_items, __FILE__, __LINE__)
00039 
00040 
00041 #include <stdlib.h>
00042 
00049 inline void *nmxp_mem_malloc(size_t size, char *source_file, int line);
00050 
00051 
00058 inline char *nmxp_mem_strdup(const char *str, char *source_file, int line);
00059 
00060 
00067 inline void nmxp_mem_free(void *ptr, char *source_file, int line);
00068 
00069 
00076 inline int nmxp_mem_print_ptr(int print_items, char *source_file, int line);
00077 
00078 
00079 #endif
00080 
00081 #endif
00082 

Generated on Wed Jul 23 02:18:05 2008 for libnmxp by  doxygen 1.5.3