|
From: Stanley <sms...@iw...> - 2004-05-11 16:00:02
|
> --- On Tue 05/11, Nicolas Rosner < ni...@bo... > wrote: > already inquired about this a few months ago. I'm just insisting, >if >you don't mind. > >Thanks, >Nicolás > I've looked for one for quite a few years, and haven't found an inexpensive one. What I've been forced to do is write some debug classes that track object creation/deletion. If you use smart pointers for all your allocated memeory, it's tedious, but doable. What I usually do is: 1) add code to assign a unique object id for every object created. 2) write a message to a log when the object is created. 3) use the smartptr to track assigments/deassigments of objects to the log. 4) Log deallocation of memory to the log 5) Write over the memory with some sort of unlikly value before delocating it. 6) Add a validity check funtion (not allways possible, but often is) that you can call at critical times. A memory check tool is much easier, but the logging process can be useful too. Gdb also has some primative memory leak detection tools, have you looked at them? Sincerly, Stanley M. Sutton _______________________________________________ |