[fpc-pascal] Mozilla XPCOM

Luiz Americo Pereira Camara luizmed at oi.com.br
Tue Jun 8 20:44:27 CEST 2010


Marcos Douglas escreveu:
> On Tue, Jun 8, 2010 at 12:55 PM, Luiz Americo Pereira Camara
> <luizmed at oi.com.br> wrote:
>   
>> Marcos Douglas escreveu:
>>     
>>> Hi Luiz,
>>>
>>> On Mon, Jun 7, 2010 at 10:35 PM, Luiz Americo Pereira Camara
>>> <luizmed at oi.com.br> wrote:
>>>
>>>       
>>>> Take a look at
>>>>
>>>> http://lazarusroad.blogspot.com/2008/11/effect-of-using-constant-parameter-for.html
>>>>
>>>>
>>>>         
>>> Then, this continue true how I said in other mail:
>>>
>>> On Mon, Jun 7, 2010 at 11:59 AM, Marcos Douglas <md at delfire.net> wrote:
>>>
>>>       
>>>> Always use 'const' for 'strings' because this is faster. Strings will
>>>> be passed by reference.
>>>>
>>>>         
>>> And about not string types, is more faster too? eg: foo (const i: Integer)
>>>
>>>       
>> No. I did this test too. Double should also benefit but the generated
>> assembler is equal with or without const.
>>     
>
> Exactly.
> Therefore I always used 'const' only at 'strings' params. I thought it
> had changed, but not.  ;-)
It can be useful for record parameters also

Luiz



More information about the fpc-pascal mailing list