2016-01-27 15:03 GMT+01:00 Sven Barth <[email protected]>: > 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. -- Best regards, Maciej Izak
_______________________________________________ fpc-devel maillist - [email protected] http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel
