edbee - Qt Editor Library
debug_new.h
Go to the documentation of this file.
1 
7 #pragma once
8 
9 #include <stdlib.h>
10 #include <stdio.h>
11 //#ifdef HAVE_MALLOC_H
12 //#include <malloc.h>
13 //#endif
14 //#include "memoryleak.h"
15 
16 
17 void* debug_malloc (size_t size, const char* file, const int line);
18 void debug_free (void* p, const char* file, const int line);
19 void* operator new (size_t size, const char* file, const int line);
20 void operator delete (void* p, const char* file, const int line);
21 void operator delete (void* p) throw();
22 void* operator new[] (size_t size, const char* file, const int line);
23 void operator delete[] (void* p, const char* file, const int line);
24 void operator delete[] (void* p) throw();
25 
26 namespace edbee {
27 
28  void pause_memleak_detection(bool value);
29 
30 } // edbee
31 
32 #define debug_new new(__FILE__, __LINE__)
33 #define new debug_new
34 #define malloc(A) debug_malloc((A), __FILE__, __LINE__)
35 #define free(A) debug_free((A), __FILE__, __LINE__)
36 
void debug_free(void *p, const char *file, const int line)
frees the given pointer
Definition: debug_new.cpp:54
Copyright 2011-2013 - Reliable Bits Software by Blommers IT.
Definition: commentcommand.cpp:22
void pause_memleak_detection(bool value)
pauses the memoryleak detection
Definition: debug_new.cpp:121
void * debug_malloc(size_t size, const char *file, const int line)
Copyright 2011-2013 - Reliable Bits Software by Blommers IT.
Definition: debug_new.cpp:25