comp.lang.ada
 help / color / mirror / Atom feed
From: Wes Groleau <wesgroleau@despammed.com>
Subject: Re: Why is memory footprint smaller when compiled static?
Date: Tue, 11 Jun 2002 14:12:43 -0500
Date: 2002-06-11T14:12:43-05:00	[thread overview]
Message-ID: <3D064BAB.4040168B@despammed.com> (raw)
In-Reply-To: mailman.1023815344.32082.comp.lang.ada@ada.eu.org


> > Plus, in Ada 95, intelligent use of child units can eliminate
> > most unused code from being linked.
> 
> Can you give an example of this? It would be nice to learn. I probably
> haven't done this so intelligently in my program :-)

package Neato_Data_Type is

  type Object is ......

end Neato_Data_Type;


package Neato_Data_Type.Display is

  procedure Draw (Item : Object);

  procedure Highlight (Item : Object);

  ....

end Neato_Data_Type.Display;

----------------

with X11R6_Bindings;
package body Neato_Data_Type.Display is ....

----------------

package Neato_Data_Type.Storage is

   procedure Retrieve ( Item : Object;
                        Key  : String );

   procedure Store    ( Item : Object;
                        Key  : String );

   ....

end Neato_Data_Type.Storage;

----------------

with ODBC_Bindings;
package body Neato_Data_Type.Storage is ....

----------------

package Neato_Data_Type.Some_Other_Feature_Set is

   .....

end Neato_Data_Type.Some_Other_Feature_Set;

------------------

with Five_Gigabyte_Math_Library;
package body Neato_Data_Type.Some_Other_Feature_Set is ....

-------------

with Neato_Data_Type.Display;
procedure Display_Manager is
 ....
end Display_Manager;

-------------

with Neato_Data_Type.Storage;
procedure Database_Manager is
 ....
end Database_Manager;

-------------

with Neato_Data_Type.Some_Other_Feature_Set;
procedure Do_Things is
 ....
end Do_Things;

---=================

If the last three guys are main programs, then
Database_Manager does not link in the ODBC bindings
or the humongous math package.  Do_Things doesn't
link in the ODBC or X11 bindings.    etc.

In Ada 83, you could make them all independent packages,
but then you had to either give up private types or
write a heck of a lot of support code into the Neato_Data_Type
package.

-- 
Wes Groleau
http://freepages.rootsweb.com/~wgroleau



  reply	other threads:[~2002-06-11 19:12 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-06-05 11:37 Why is memory footprint smaller when compiled static? Grein, Christoph
2002-06-05 12:36 ` Preben Randhol
2002-06-05 13:42   ` Mark Johnson
2002-06-06  0:02   ` Steven Deller
2002-06-06 10:35     ` Preben Randhol
2002-06-06 14:26     ` Gautier
2002-06-06 15:08       ` Jean-Marc Bourguet
2002-06-06 15:24         ` Jean-Pierre Rosen
2002-06-06 19:35           ` Jeffrey Carter
2002-06-10 23:51     ` Randy Brukardt
2002-06-11  0:53       ` Robert A Duff
2002-06-11 16:45         ` Wes Groleau
2002-06-11 17:08           ` Preben Randhol
2002-06-11 19:12             ` Wes Groleau [this message]
2002-06-11 21:38               ` Randy Brukardt
2002-06-11 21:32         ` Randy Brukardt
  -- strict thread matches above, loose matches on Subject: below --
2002-06-04 15:14 Preben Randhol
2002-06-04 16:13 ` Mark Johnson
2002-06-04 21:01 ` Florian Weimer
2002-06-04 21:02 ` Florian Weimer
2002-06-04 21:03 ` Florian Weimer
2002-06-05 11:10   ` Preben Randhol
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox