[Lazarus] Extending TRect breaks Lazarus

Mattias Gaertner nc-gaertnma at netcologne.de
Tue Nov 10 13:08:51 CET 2015


On Tue, 10 Nov 2015 12:26:56 +0100
J├╝rgen Hestermann <juergen.hestermann at gmx.de> wrote:

>[...]
> Does that mean, that local variables and with statements are treated completely identically?

A local var can be changed. Without optimization the compiler puts the
local var on the stack. With optimization enabled the compiler can
find out that the local var is only read, which is also true for a with-expression and applies the same optimizations.

Optimizing read only variables is basic code optimization.

> Are both held in registers with the same mechanism and will there never be an (speed) adavantage of one of them?
> If there is only the chance that it may speed up the code (even when only on certain platforms) then I would like to know it.

If speed matters you should enable optimization. When optimization is
enabled there is no difference.

Mattias




More information about the Lazarus mailing list