[fpc-devel] issue in heaptrc?

Martin lazarus at mfriebe.de
Thu Jan 26 16:57:58 CET 2012


On 26/01/2012 13:56, Pierre Free Pascal wrote:
>    Yes, you are right...
>
> I just committed a fix (together with multi-threaded windows executable
> support in trunk)
> If you have svn trunk, could you check that revision 20181 fixes
> the problem you report?
>
> Thanks in advance,
>
It looks right from the code.

it will be a while before I run it.  After all it really slows things 
down...

May I mention 2 ideas?

1)
I observed that at least in my case, I often get repeated checks for the 
same node.
Caching the last (or last 2) found node(s) (and invalidating the cache 
in trace_free_mem and trace_realloc_mem), and checking that last node 
first, did some speed improvement.

2)
This is not that easy to fix
    SomeObj.FField
generates code like

   move <addr_of_SomeObj>, <register>  // e.g. ebp

   move <register>, .ax
   call checkpointer  // chek the objects first byte is in alloc mem

   move <offset_of_FField>(<register>) , <foo>  // use the field

it is never tested that the field itself is in alloc mem. But not only 
should the field be in alloc mem, it should be in the same block.

It would require something like
    checkpointer(<addr_of_SomeObj>, <offset_ofFField>)
and test that the block has a minimum amount of space, after the 
required address





More information about the fpc-devel mailing list