[fpc-devel] For Stocki. Regarding interfaces.

thaddy at thaddy.com thaddy at thaddy.com
Tue Aug 26 17:27:16 CEST 2014


Since your report was closed and I didn't fully (the closing) agree with 
that without research, here's a part of my research:

I found this reply by Danny Thorpe on stackoverflow:

To quote:
"I recall there have been a few bugs in this area over the years. Long 
ago (D3? D4?), the compiler didn't reference count the intermediate 
value at all. It worked most of the time, but got into trouble in 
parameter alias situations. Once that was addressed there was a follow 
up regarding const params, I believe./*There was always a desire to move 
disposal of the intermediate value interface up to as soon as possible 
after the statement in which it was needed, but I don't think that ever 
got implemented in the Win32 optimizer because the compiler just wasn't 
set up for handling disposal at statement or block granularity*/."

As you will see, the original intention by the Delphi architects was to 
release an interface as soon as possible.
The problem was**and is** that their compiler infrastructure doesn't 
allow that.
So the discussion on the buglist should be read in that context.

Even the designer of Delphi's interface implementation wished they were 
able to have a better implementation.
CUDO's to the Freepascal compiler guys for more or less achieving that ;)

You have to read it very carefully. It is not about the question, but 
about the *last part of the answer by Danny.**
I hope this sheds some new light on the matter that bothers you so much.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freepascal.org/pipermail/fpc-devel/attachments/20140826/20f009cc/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 4243 bytes
Desc: S/MIME Cryptographic Signature
URL: <http://lists.freepascal.org/pipermail/fpc-devel/attachments/20140826/20f009cc/attachment.bin>

More information about the fpc-devel mailing list