This is incorrect. The compiler optimisation switch does not control how
the linker works. Basically any unit level procedures and functions or
symbol that are not referred to are removed by the linker, optimisation or
not. All static or class methods are similarly treated. Any virtual or
dynamic methods, even private ones, are NOT elliminated by the linker and
will always be included. Code in the initialization section and in the DPR
is always included.
In a DPK, the whole DCU is included.
Related ... all class data members are always created when a class is
constructed, even unused private members.
From: Kyley Harris <[EMAIL PROTECTED]>
Date: Wed, 10 Aug 2005 15:01:45 +1200
Delphi links the entire DCU into the application. The idea is to keep dcu's
as concise as necessary, and to remove
unneeded ones from the uses clauses. with Optimization turned on when you
compile a dcu it will remove any
lines of code that are perceived as unnecessary to the application.
John Bird wrote:
A question about how Delphi works...
1 - Main question is about Library routines. I maintain a library unit
with
a lot of (non-visual) procedures and functions for various miscellaneous
tasks - date formatting, number formatting, file i/o etc. Some 70
routines
and growing. Now when I use this unit in a program, does (a) everything
in
the unit get compiled and linked in, or (b) is it smart enough just to get
just the code called (including library procedures called from another
called from the program). I have come from another language where it
always
did (b), hoping Delphi is as smart. If not, then I need to separate my
library procedures into smaller logically related units rather than one
humungous big unit with everything in it to avoid the programs getting
bloated with non-used code.
John B
______________________________________________
Delphi mailing list
[email protected] http://ns3.123.co.nz/mailman/listinfo/delphi
_______________________________________________
Delphi mailing list
[email protected]
http://ns3.123.co.nz/mailman/listinfo/delphi
_______________________________________________
Delphi mailing list
[email protected]
http://ns3.123.co.nz/mailman/listinfo/delphi
_________________________________________________________________
Shop til you drop at XtraMSN Shopping http://shopping.xtramsn.co.nz/home/
_______________________________________________
Delphi mailing list
[email protected]
http://ns3.123.co.nz/mailman/listinfo/delphi