[Lazarus] Log4D weirdness

Hans-Peter Diettrich DrDiettrich2 at gmx.de
Thu Jan 1 23:15:52 CET 2015


Am 31.12.2014 um 21:51 schrieb Marco van de Voort:

> Afaik the problem is that "const" as used in classic delphi is not 
> very portable. In theory it is specified as immutable (can't be 
> modified), but widely abused to mean "by reference".
Const parameters exist for optimization, the compiler is allowed to pass 
them by reference instead of a copy.
> This happens to be the case for x86 ABIs, but this is not portable 
> (which why FPC introduced constref)
I don't see how this is not portable - as long as the procedure is OPL. 
External procedures of other languages don't leave room for such an 
optimization, even in x86 ABIs, that's why constref was introduced for them.

DoDi




More information about the Lazarus mailing list