TIP: Click on subject to list as thread! ANSI
echo: pascal
to: JUD MCCRANIE
from: MIKE COPELAND
date: 1998-04-18 13:59:00
subject: OO MEMORY USAGE?

 j> BP/TP discards unused units, or references to unused dlls.  However, if 
 j> you use 1 procedure, function, type, constant, or variable from a unit, 
 j> you will have the entire unit in your program.
 JM> Are you sure?  I thought smart linking eliminated unused code.
   Not exactly that - S/L doesn't link into the .EXE file being built
code (and data) which _isn't_referenced_.  That's not as simple as it
might seem, because there are all sorts of indirect references possible
in referenced Units, and the S/L of Var data is done by "Var blocks".
That is, if a Unit has only a single Var statement, but many
declarations of data under it, a single reference to any one of the var
items will cause _all_ the var data to be linked into the .EXE.
   Therefore, it's important to block (segregate) data variables in
multiple Var blocks. according to the applications which use them.  It's
equally important to understand your Units' usages to be able to do
this.  The same is true for subprograms, Unit initialization code (if a
var is initialized in a Unit, it's bound into any .EXE which "Uses" the
Unit), and the subtleties of indirect references within a Unit's
subprograms.  All this takes a lot of experience - much of it painful
when programs/data are found to grow too large - and a good "feel" for
your work.  There are no simple general formulas for this, nor are there
any "absolutes" such as you imply in your statement above.  S.L is a
feature or tool in the TP/BP system, but it requires knowledge and care
to use it most effectively.
... Ignore your health and it will go away.
--- OMX/Blue Wave/DOS v2.20
---------------
* Origin: Mike's Place (1:114/307.0)

SOURCE: echomail via exec-pc

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.