Ambitious contributor
6Mar2008,12:54   #21
rahul.mca2001's Avatar
i tried and it really works well
Go4Expert Member
7Mar2008,15:48   #22
bashamsc's Avatar
Nice program to detect memory leak. But i want to know how to recover the memory after memory leak and how to prevent it.
TechCake
7Mar2008,19:48   #23
asadullah.ansari's Avatar
This program will tell you
1. line number
2. source file name
3. starting address
4. total bytes .
If this is your program then go to that line and call free function for that pointer which is pointing to memory and not deallocated.

If that is not your program means it may be in binary then You have four information by running this program , then take a pointer which will point to constant address as above 3.
and set the offset as required based on as above 4 info. then call free function for this pointer.
Go4Expert Founder
9Mar2008,10:58   #24
shabbir's Avatar
bubyfound, Make sure we discuss only in English.
Ambitious contributor
10Mar2008,11:06   #25
debleena_doll2002's Avatar
Quote:
Originally Posted by shabbir
bubyfound, Make sure we discuss only in English.
I am unable to get yout statement. shabbir, Please Can you use QUOTE so that we can easily identify.
Go4Expert Founder
10Mar2008,11:48   #26
shabbir's Avatar
bubyfound, had one post in non-English and so its directed to him. I have not quoted his non-english posts
Go4Expert Member
10Mar2008,11:48   #27
rashida.par's Avatar
very nice article
Newbie Member
21Mar2008,23:06   #28
donakalz's Avatar
Thanks man for the very very nice code.

However, I am trying to create a version which works for C++ operators new and delete like this:

#define new (elemSize) MyNew (elemSize, __FILE__, __LINE__)
#define new [](elemSize) MyNewArray (elemSize, __FILE__, __LINE__)
#define delete(memPointer) MyDelete (memPointer)
#define delete [](memPointer) MyDeleteArray (memPointer)

and I get the following compiler errors:
24:1 [Warning] "new" redefined
26:1 [Warning] "delete" redefined


Can you think of a workaround for this? Thanks.

Don
Newbie Member
24Mar2008,16:54   #29
donakalz's Avatar
Wow. So quiet in here. Hello? Anybody here?
Contributor
25Mar2008,15:17   #30
lead.smart34's Avatar
really a very nice code