[Lazarus] Large program size - 1.8 MB for empty GUI project

Mattias Gaertner nc-gaertnma at netcologne.de
Tue Apr 7 17:21:10 CEST 2009


On Tue, 7 Apr 2009 15:55:20 +0200
Graeme Geldenhuys <graemeg.lists at gmail.com> wrote:

> 2009/4/7 Mattias Gärtner <nc-gaertnma at netcologne.de>:
> >
> > Uses sections in implementation sections are buggy as long as I
> > know fpc. The problems are known but apparently too hard to track
> > and fix. The bugs appear at random and with various degrees
> > depending on platform and fpc version. In some years you think the
> > bugs are fixed, and then they come back. You have been warned:
> > Don't use the imp sections.
> >
> > I thought this was known:
> > http://wiki.lazarus.freepascal.org/DesignGuidelines
> 
> This is the first I here of this. 

Maybe because you follow our advice to always do a 'make clean all' on
the lazarus sources, which 'solves' the bug in most cases.
The bug(s) can not be reproduced easily, but when it appears it is
reproducable. The problem is that you need some ppu to demonstrate and
you can not feed 100MB into the bug tracker.

The last time happened when Martin added some unit cycles in synedit.
Under FPC 2.2.3 it worked most of the time. Under FPC 2.3.1 only a
clean rebuild worked.


> I was always taught to limit the
> usage of the Interface section's uses clause, so you can prevent
> circular unit issues. So is FPC the opposite of Delphi in this
> regards?

No, no, you are right. The implementation uses section is not buggy per
se. But with them you can build the circular unit dependencies. With
merely the interface uses sections you can not.
As long as you keep an acyclic hierarchy you can use whatever you like.

When using only interface uses sections you can not even create
accidentally a cycle. That's why I recommend to avoid imp uses sections.

 
> I have used FPC since 2.0.2 under Linux and Windows and haven't had
> any issues. I limit the usage of interface uses clause as much as
> possible. I believed that is why the smartlinking works so well with
> fpGUI - I can create a GUI application that is only 340KB in size.

AFAIK smart linking has nothing to do with unit interdependencies.
Of course you are right that every unit interdependency makes improving
smart linking more difficult.


Mattias





More information about the Lazarus mailing list