[fpc-devel] constref in Windows

Jonas Maebe jonas.maebe at elis.ugent.be
Sat Nov 20 11:53:51 CET 2010


On 19 Nov 2010, at 17:56, Paul Ishenin wrote:

> 19.11.2010 23:47, Jonas Maebe wrote:
>> 
>> Well, it could be done since "const" is implementation-dependent, but it would force all non-x86 platforms to pass all const parameters by reference by default, which may not be desirable from an efficiency point of view.
> As I understand not all const parameters are passed by reference in delphi stdcall implementation but only records? Or say integer/byte will be passed by reference too?

You proposed to make "const = constref on stdcall convention". constref passes everything by reference (that's the literal meaning of the keyword "const argument by reference").

Also, the default calling convention on non-x86 platforms is supposed to be compliant with the default ABI of the platform. Many of these platforms pass small records all by value (const or not).


Jonas


More information about the fpc-devel mailing list