[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-devel
Subject:    Re: Tracking allocated memory (was: Tracking memory leaks -- advice
From:       Harri Porten <porten () tu-harburg ! de>
Date:       1999-06-23 11:29:51
[Download RAW message or body]

Pietro Iglio wrote:
> 
> On 6/20/99, 10:45:33 AM, Stephan Kulow <coolo@itm.mu-luebeck.de> wrote
> > Well, if you use the dmalloc library (just install dmalloc-0.4 and use
> > --with-dmalloc in kdelibs), you'll get a function called
> dmalloc_log_stats(),
> > which you can call as many times as you want. Unfortunatly it's output
> > is a bit more verbose than say one int :)
> 
> Well, I discovered that you can trace the value of the global variable
> alloc_current,
> that stores the amount of memory that has been allocated and not freed
> yet.

Thanks for that hint. So you removed the `static' keyword from the
sources and referred to it with `extern' ?

> Displaying the value of alloc_current during a debugging session has
> been very helpful to discover some memory leaks in functions that should not have left
> allocated memory (just look at the value of alloc_current before and after the
> execution of the function).

I agree that is very useful. Shouldn't we suggest to the author that
making this a real function would be a good thing ?

Harri.

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic