jdk/src/share/demo/jvmti/hprof/debug_malloc.h
changeset 13678 5c8001201f98
parent 10292 ed7db6a12c2a
child 14342 8435a30053c1
equal deleted inserted replaced
13508:7c6aa31ff1b2 13678:5c8001201f98
    57 #ifdef DEBUG
    57 #ifdef DEBUG
    58 
    58 
    59 #include <stdlib.h>
    59 #include <stdlib.h>
    60 #include <string.h>
    60 #include <string.h>
    61 
    61 
       
    62 /* Use THIS_FILE when it is available. */
       
    63 #ifndef THIS_FILE
       
    64     #define THIS_FILE __FILE__
       
    65 #endif
       
    66 
    62 /* The real functions behind the macro curtains. */
    67 /* The real functions behind the macro curtains. */
    63 
    68 
    64 void           *debug_malloc(size_t, const char *, int);
    69 void           *debug_malloc(size_t, const char *, int);
    65 void           *debug_realloc(void *, size_t, const char *, int);
    70 void           *debug_realloc(void *, size_t, const char *, int);
    66 void           *debug_calloc(size_t, size_t, const char *, int);
    71 void           *debug_calloc(size_t, size_t, const char *, int);
    69 
    74 
    70 #endif
    75 #endif
    71 
    76 
    72 void            debug_malloc_verify(const char*, int);
    77 void            debug_malloc_verify(const char*, int);
    73 #undef malloc_verify
    78 #undef malloc_verify
    74 #define malloc_verify()     debug_malloc_verify(__FILE__, __LINE__)
    79 #define malloc_verify()     debug_malloc_verify(THIS_FILE, __LINE__)
    75 
    80 
    76 void            debug_malloc_police(const char*, int);
    81 void            debug_malloc_police(const char*, int);
    77 #undef malloc_police
    82 #undef malloc_police
    78 #define malloc_police()     debug_malloc_police(__FILE__, __LINE__)
    83 #define malloc_police()     debug_malloc_police(THIS_FILE, __LINE__)
    79 
    84 
    80 #endif
    85 #endif