|
From: Nicholas N. <nj...@ca...> - 2003-10-30 16:08:50
|
On Thu, 30 Oct 2003 sf...@ge... wrote: > I saw the code that skips the stack during leak detection. > > I've coded and am currently testing a modification to the memory leak > detection to flag lost blocks that are pointed to by unused memory > (free mem or other lost blocks). E.g. a circular linked list or a > double linked list will be detected. As will a leaked block that is > pointed to by a freed block (it's not enough to free the head of a list, > you have to walk the list). > > Hopefully I'll make Nicholas happy (as per his last line in > http://sourceforge.net/mailarchive/message.php?msg_id=4892174 ). > > I will outline the algorithm below. Please let me know if you see Have you considered more standard garbage collection algorithms, eg. tracing through all the reachable objects from a root set? I think the algorithm you described might, in effect, do the same thing, but I wonder if doing it in a more straightforward GC-style way would be simpler? > But maybe that is ok. Good programmers free all their memory > before program exit. Really? Hmm. Good programmers don't create space leaks either :) N |