[fpc-devel]Improvements for heaptrc.pp

Peter Vreman peter at freepascal.org
Wed Sep 4 15:52:51 CEST 2002


> On Wed, 4 Sep 2002 12:11:51 GMT
> Peter Vreman <peter at freepascal.org> wrote:
> 
> > > Here are some suggestions to improve heaptrc.pp.
> > > 
> > > 1. getmem_cnt, freemem_cnt, getmem_size, freemem_size, getmem8_size, freemem8_size
> > should
> > be readable via functions in the interface. Very useful for optimization.
> > > 
> > > 2. QuickTrace = false is very slow, but also very useful. It would be nice to have a
> > procedure, that can be called at any time, and that does a big check. For example:
> > > 
> > > procedure CheckHeap;
> > > var p: pointer;
> > > begin
> > >   QuickTrace:=false;
> > >   GetMem(p,4);
> > >   FreeMem(p);
> > >   QuickTrace:=true;
> > > end;
> > > 
> > > 3. Move QuickTrace into the interface part.
> 
> Sorry, the 3. is nonsense. It is already in the interface.
> 
>  
> > The quicktrace improvement can only be done for the heaptrc available in 1.1. That
version
> > supports extra information that can have different sizes
> 
> How is this related?
> The quicktrace flag is just for checking the whole heap. I used it, and it seems to work
very nice.

Sorry, i thought that it also increases the size of the backtraces.

What can be a speed improvement is to have a value that determines how often the whole
heap is checked. So you can do it only once for each 10 allocations.

Also checkpointer can shall be extended with a possibility to check if the pointer is not
in one of the freed memory blocks. Together with the keep_released flag it can then be
used to find dangling pointers.







More information about the fpc-devel mailing list