[fpc-devel] Need patch for bugs : 0011503 / 0009472

Boian Mitov mitov at mitov.com
Thu Jun 19 13:53:07 CEST 2008

      Hi Jonas,

This functionality works in all versions of Delphi 5-2007. We support them 
all, and we have done so for years. We have no problems to compile with such 
optimizations turned off. We need proper reference counting. We have over 
300 Delphi components in 5 released and 3 libraries under current 
development, spreading over 4 million lines of code. We are looking to port 
it to Linux, and other platforms. The Lazarus looks like the natural 
solution. We have no problems creating a clone of it, or developing 
alternative compiler from scratch. We plan to allow C++ users to also use 
the library, as we provide C++/MFC and .NET component wrappers to our 
customers. If we need to we can simply fix the compiler for our needs and 
sell only compiled C++ supporting versions, or if you agree to allow some 
override to the behavior we can support the Lazarus and free Pascal too. We 
believe that as one of the biggest component vendors in the world, our 
support for Lazarus will help the project a lot. However for that we 
crucially need this problem fixed. CodeGear has done fixes for us in the 
past, in order to help us continue to support the platform, as they have 
done for other vendors, and we are very, very grateful for that, and have 
help them (convert) many of our .NET customers. We will be equally grateful 
for any help you can offer in our attempts to support Lazarus. We believe 
this will only help the community, and the popularity of the product.
I have downloaded the source, and I will see if we can tweak it and add some 
compiler option to support this somehow.
You can take a look at our currently available products here : www.mitov.com 
, and yes, we are working to make all this available in Lazarus ;-) .

  With best regards,
    Boian Mitov

Mitov Software

----- Original Message ----- 
From: "Jonas Maebe" <jonas.maebe at elis.ugent.be>
To: "FPC developers' list" <fpc-devel at lists.freepascal.org>
Sent: Thursday, June 19, 2008 4:39 AM
Subject: Re: [fpc-devel] Need patch for bugs : 0011503 / 0009472

> On 19 Jun 2008, at 13:21, Boian Mitov wrote:
>> Thank you!
>> I don't understand. 0011503 is a major failure. Is it in the  compiler or 
>> in some library?
> Please read the comments to http://bugs.freepascal.org/view.php? id=9472. 
> The whole issue is discussed there in great detail.
>> This is a huge problem. This code must work the same way in both  cases 
>> but it does not. We are porting a huge library of over 4  million lines 
>> of code from Delphi. This is a major show stopper. I  can probably take a 
>> look in the compiler as it will be much easier  and faster for us to fix 
>> the compiler to be Delphi compatible rather  than rewriting the 
>> libraries. They rely heavily on interfaces and  the correct reference 
>> counting. Rewriting this even if desirable  will delay the project with 
>> at least a year at best. By definition  when there are no active 
>> references to an interface it must be  released. This is a total failure 
>> of the functionality.
> There are active references, namely in an invisible temp. When this 
> invisible temp is destroyed (at the function exit), the interface is 
> freed.
> It is wrong to assume that implicit temps which still contain  references 
> to interfaces (or ansistrings, or any other reference  counted type) can 
> never exist, because this is an implementation  detail over which the 
> compiler has full control. This can also happen  in Delphi under certain 
> circumstances by the way (namely if it cannot  guarantee that optimising 
> the interface assignment is safe without  using a temp).
> The purpose of automatic reference counting is simply that memory 
> management is automated. It is not to guarantee the same semantics as 
> what you would get in a manual reference counting scheme where you are  in 
> full control of when and where reference counts are increased and 
> decreased. In principle, a periodic mark and sweep would also still be 
> correct behaviour.
> Newer versions of FPC optimise assignments of function results more 
> aggressively so you will more often get reference counting behaviour  like 
> in Delphi, but we do not guarantee in any way that it will be  100% 
> identical. We only emulate the Delphi language, not the  implementation 
> details of the Delphi compiler or code generator.
> Jonas
> _______________________________________________
> fpc-devel maillist  -  fpc-devel at lists.freepascal.org
> http://lists.freepascal.org/mailman/listinfo/fpc-devel 

More information about the fpc-devel mailing list