- Main Page
- Related Pages
- Classes
- Files

- File List
- File Members

# 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, print_sfs) nmxp_mem_null_function()
    00023 #define NMXP_MEM_PRINT_SFS() nmxp_mem_null_function()
    00024
    00025
    00030 int nmxp_mem_null_function();
    00031
    00032 #else
    00033
    00034 #define NMXP_MEM_MALLOC(size) nmxp_mem_malloc(size, __FILE__, __LINE__)
    00035 #define NMXP_MEM_STRDUP(str) nmxp_mem_strdup(str, __FILE__, __LINE__)
    00036 #define NMXP_MEM_FREE(ptr) nmxp_mem_free(ptr, __FILE__, __LINE__)
    00037 #define NMXP_MEM_PRINT_PTR(print_items, print_sfs) nmxp_mem_print_ptr(print_items, print_sfs, __FILE__, __LINE__)
    00038 #define NMXP_MEM_PRINT_SFS() nmxp_mem_print_sfs(__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, int print_sfs, char *source_file, int line);
    00077
    00078
    00079 #endif
    00080
    00081 #endif
    00082