37 #ifndef NVWA_DEBUG_NEW_H
38 #define NVWA_DEBUG_NEW_H
46 void*
operator new(
size_t size,
const char* file,
int line);
47 void*
operator new[](
size_t size,
const char* file,
int line);
48 void operator delete(
void* ptr,
const char* file,
int line)
_NOEXCEPT;
49 void operator delete[](
void* ptr,
const char* file,
int line)
_NOEXCEPT;
77 #ifndef _DEBUG_NEW_REDEFINE_NEW
78 #define _DEBUG_NEW_REDEFINE_NEW 1
92 #ifndef _DEBUG_NEW_TYPE
93 #define _DEBUG_NEW_TYPE 1
118 void* addr,
void** stacktrace);
140 # if _DEBUG_NEW_TYPE == 1
141 # define DEBUG_NEW NVWA::debug_new_recorder(__FILE__, __LINE__) ->* new
143 # define DEBUG_NEW new(__FILE__, __LINE__)
146 # if _DEBUG_NEW_REDEFINE_NEW
147 # define new DEBUG_NEW
149 # ifdef _DEBUG_NEW_EMULATE_MALLOC
152 # define malloc(s) ((void*)(new char[s]))
154 # define malloc(s) ((void*)(DEBUG_NEW char[s]))
156 # define free(p) delete[] (char*)(p)
#define NVWA_NAMESPACE_BEGIN
#define NVWA_NAMESPACE_END
debug_new_recorder(const debug_new_recorder &)
_Tp * operator->*(_Tp *ptr)
debug_new_recorder & operator=(const debug_new_recorder &)
debug_new_recorder(const char *file, int line)
void _M_process(void *ptr)
bool(* leak_whitelist_callback_t)(char const *file, int line, void *addr, void **stacktrace)
static debug_new_counter __debug_new_count
void(* stacktrace_print_callback_t)(FILE *fp, void **stacktrace)
const char * new_progname
leak_whitelist_callback_t leak_whitelist_callback
int check_mem_corruption()
stacktrace_print_callback_t stacktrace_print_callback