<p>Am 27.01.2016 15:52 schrieb "Maciej Izak" <<a href="mailto:hnb.code@gmail.com">hnb.code@gmail.com</a>>:<br>
>> The point is that it is not necessarily guaranteed on each and every platform that the parameter passing of a (interface) method is the same as for a global function with an additional instance parameter. This *might* be true for those platforms on which Windows runs and thus we need to correctly support COM interfaces, but on other platforms this *could* be completely different (e.g. a platform could pass the instance in a register instead of the stack while normal functions get all their parameters from the stack; this would totally mess up the parameters that the functions expects).<br>
><br>
> We need to somehow clarify many things in this field. My next big milestone is RTTI.Invoke method (I'd like to omit implementing this :P). For example only in FPC dyn. array parameter is passed on stack instead of by reference (in opposition to Delphi)... with small change in r30870 for register calling convention (changed for properties). Ofc. is possible to use constref modifier but... Arghhhh...</p>
<p>The interesting thing about Invoke() will be support on other platforms ;) We've not yet decided how we'll tackle it...</p>
<p>Dynamic arrays were changed to be passed on stack in 2.7.1 on purpose AFAIK.</p>
<p>Regards,<br>
Sven</p>