Re: [Lazarus] Large program size - 1.8 MB for empty GUI project (uses clause in initialization vs implementation?)

2009-04-10 Thread Marco van de Voort
On Fri, Apr 10, 2009 at 02:22:06PM +0400, dmitry boyarintsev wrote: > Can compiler detect, if initialized procedure variable is not used and > smartlink it off? > In the following example: > there's a global procedure variable. it's initialized by unit2, that > is used by program. > but even if it'

Re: [Lazarus] Large program size - 1.8 MB for empty GUI project (uses clause in initialization vs implementation?)

2009-04-10 Thread Joost van der Sluis
Op woensdag 08-04-2009 om 17:14 uur [tijdzone +0100], schreef Martin Friebe: > Alexey S. Smirnov wrote: > > Vincent Snijders ?: > >> Can somebody explain to me why smartlinking works better when a unit > >> is in the implementation section than when it is in the interface > >> section? I though

Re: [Lazarus] Large program size - 1.8 MB for empty GUI project (uses clause in initialization vs implementation?)

2009-04-10 Thread dmitry boyarintsev
Can compiler detect, if initialized procedure variable is not used and smartlink it off? In the following example: there's a global procedure variable. it's initialized by unit2, that is used by program. but even if it's initialized, the procedure itself (someProc) is never called. So, is it possib

Re: [Lazarus] Large program size - 1.8 MB for empty GUI project (uses clause in initialization vs implementation?)

2009-04-10 Thread Marco van de Voort
On Thu, Apr 09, 2009 at 11:35:44AM +0200, svaa wrote: > Vincent Snijders escribi??: > > No, the initialization section of the graphics unit and its dependencies > > is used. The lesson is: you cannot smart link away initialization (and > > finalization) sections of a unit. > > Why not? > > Is t

Re: [Lazarus] Large program size - 1.8 MB for empty GUI project (uses clause in initialization vs implementation?)

2009-04-09 Thread Vincent Snijders
svaa schreef: > Vincent Snijders escribió: >> No, the initialization section of the graphics unit and its dependencies >> is used. The lesson is: you cannot smart link away initialization (and >> finalization) sections of a unit. >> > Why not? > > Is there are a design reason for such behavior?

Re: [Lazarus] Large program size - 1.8 MB for empty GUI project (uses clause in initialization vs implementation?)

2009-04-09 Thread svaa
Vincent Snijders escribió: > No, the initialization section of the graphics unit and its dependencies > is used. The lesson is: you cannot smart link away initialization (and > finalization) sections of a unit. > > Vincent > ___ > Lazarus mailing list >

Re: [Lazarus] Large program size - 1.8 MB for empty GUI project (uses clause in initialization vs implementation?)

2009-04-09 Thread Marc Weustink
Alexey S. Smirnov wrote: > So. Ones more - to reduce Lazarus-aware projects code size we shall > first check and cleanup "Uses" sections to remove unused units, and next > - test Initialization and Finalization sections. Do we really need them? > For the Dephi times I remember that those section

Re: [Lazarus] Large program size - 1.8 MB for empty GUI project (uses clause in initialization vs implementation?)

2009-04-09 Thread Alexey S. Smirnov
Vincent Snijders пишет: No, the initialization section of the graphics unit and its dependencies is used. The lesson is: you cannot smart link away initialization (and finalization) sections of a unit. Vincent But result is very understandable - if we have some unused units (with Ini

Re: [Lazarus] Large program size - 1.8 MB for empty GUI project (uses clause in initialization vs implementation?)

2009-04-09 Thread Vincent Snijders
Alexey S. Smirnov schreef: > Florian Klaempfl пишет: >> This could be simply the influence of a different memory layout of the exe. >> > It seams that I was wrong. So. Lets do next small test. > The main program is: > |program small_test; > {$mode objfpc}{$H+} > > uses > Unit1; > begin > Prin

Re: [Lazarus] Large program size - 1.8 MB for empty GUI project (uses clause in initialization vs implementation?)

2009-04-09 Thread Alexey S. Smirnov
Florian Klaempfl пишет: This could be simply the influence of a different memory layout of the exe. It seams that I was wrong. So. Lets do next small test. The main program is: program small_test; {$mode objfpc}{$H+} uses  Unit1; begin  Print_Hello_Word; end. Uni1.pas is: Unit unit1;

Re: [Lazarus] Large program size - 1.8 MB for empty GUI project (uses clause in initialization vs implementation?)

2009-04-08 Thread Alexey S. Smirnov
Florian Klaempfl пишет: Alexey S. Smirnov schrieb: This could be simply the influence of a different memory layout of the exe. Yes, potentially... But, please - explain - why compiler can simply detect and remove unused Unit from Implementation section and NEWER do that for Inter

Re: [Lazarus] Large program size - 1.8 MB for empty GUI project (uses clause in initialization vs implementation?)

2009-04-08 Thread Florian Klaempfl
Alexey S. Smirnov schrieb: > Martin Friebe пишет: >> Is this documented somewhere? I can't follow the logic anyway, the scope >> how much my code uses of another unit can not be predicted, simply by >> where I include the other code? >> >> Actually, I do believe I have seen examples where code fo

Re: [Lazarus] Large program size - 1.8 MB for empty GUI project (uses clause in initialization vs implementation?)

2009-04-08 Thread Alexey S. Smirnov
Martin Friebe пишет: Is this documented somewhere? I can't follow the logic anyway, the scope how much my code uses of another unit can not be predicted, simply by where I include the other code? Actually, I do believe I have seen examples where code form units used in the interface was

Re: [Lazarus] Large program size - 1.8 MB for empty GUI project (uses clause in initialization vs implementation?)

2009-04-08 Thread Martin Friebe
Alexey S. Smirnov wrote: > Vincent Snijders ?: >> Can somebody explain to me why smartlinking works better when a unit >> is in the implementation section than when it is in the interface >> section? I thought for smartlinking it doesn't make a difference, the >> unit is used anyway. >> > Th