[fpc-devel] Generics.Collections as package for Lazarus or package for FPC RTL

Michael Van Canneyt michael at freepascal.org
Wed Jan 27 15:13:16 CET 2016

On Wed, 27 Jan 2016, Sven Barth wrote:

> http://stackoverflow.com/questions/17951412/what-does-the-default-tarray-sort-comparator-actually-do-and-when-would-you-use
> Thank you for the link, because now I know what was *really* bugging me
> about the code all the time (you know that feeling that you instinctively
> know that something is wrong, but you can't really pinpoint.it? ;) ). 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).
> And *this* is something I don't want to deal with as this could potentially
> break every time we improve or fix something in the parameter passing code
> and then only for specific platforms...
> 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.

Thanks Sven,

I am glad there is a solution, I was afraid there would not be one, and then
we'd be caught in some kind of stalemate :-)


More information about the fpc-devel mailing list