Am 27.01.2016 16:51 schrieb "Maciej Izak" <hnb.c...@gmail.com>:
>
> 2016-01-27 15:03 GMT+01:00 Sven Barth <pascaldra...@googlemail.com>:
>>
>> 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).
>>
>> So if you would instead change the code to use real class instances that
implement the interfaces (they can be lazily allocated singletons or so)
then I'd definitely be inclined to include the code in trunk.
>
> FPC Generics.Default implementation is a little different than Delphi
implementation. There is no global function with additional instance/self
parameter, so I think the problem don't affect Generics.Defaults and i
don't need to change anything.
>
> All is passed as "true" self parameter, there is no fake or trick :P.
>
> All is achieved by "class function" method syntax, which always has
"self" parameter.

I'll need to look at your code again, but even for class functions the same
rules (and worries) as for normal methods apply.

Regards,
Sven
_______________________________________________
fpc-devel maillist  -  fpc-devel@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel

Reply via email to