[fpc-devel] Need heap manager -gv explanation

Tomas Hajny XHajT03 at hajny.biz
Tue Apr 29 09:43:34 CEST 2014

On Tue, April 29, 2014 08:45, Sergei Gorelkin wrote:
> -gv switch in command line disables the optimized i386 Move procedure (and
> that's basically the only thing it does),

I presume that you talk about the RTL side (i.e. compiling RTL with -gv).
In compiler (regardless whether you use a RTL compiled with -gv or not) it
triggers adding CMem (plus also some other changes related to debug
information in stabs).

> so it indeed should cause slowdown.

If I understand it correctly, the original poster mentioned that use of
valgrind _improves_ speed (considerably) in his case. I still believe that
it may be due to use of CMem instead of the standard heap manager.

> Comments say that valgrind (some pretty old
> version of it) is unable to handle the optimizied Move code. In the
> meantime, valgrind was
> presumably fixed. At least since my involvement with FPC back in 2005 I
> was able to use valgrind to
> profile programs without any trouble, and without recompiling them with
> -gv.
> So maybe it's time reconsider the action of -gv switch, or to remove it
> altogether.

I can't comment on that; I believe Jonas used Valgrind quite a lot in the
past, so he might be able to comment on requirements for its use on
various FPC supported platforms.


More information about the fpc-devel mailing list