[fpc-devel] Generics.Collections as package for Lazarus or package for FPC RTL
Maciej Izak
hnb.code at gmail.com
Wed Jan 27 15:52:09 CET 2016
2016-01-27 15:03 GMT+01:00 Sven Barth <pascaldragon at googlemail.com>:
> 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? ;) ).
>
I have those feeling half of my life as programmer >.<
> 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).
>
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...
> 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.
>
To implement this addition would be nice to fix this bug:
http://bugs.freepascal.org/view.php?id=29245
Currently any class var (precisely "managed var" kind, like dyn array or
interface) allocated in class constructor is released before class
destructor.
> And before you say that Delphi does it differently: the Delphi developers
> only have to maintain the code for 3 platforms (i386, x86_64 and ARM), we
> however have more to maintain and thus the chances for breakage are higher.
>
Life of FPC developer is so painful and happy at the same time...
--
Best regards,
Maciej Izak
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freepascal.org/pipermail/fpc-devel/attachments/20160127/cd878eb8/attachment.html>
More information about the fpc-devel
mailing list