From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-0.3 required=5.0 tests=BAYES_00,FREEMAIL_FROM, REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,79b248c1cf206957 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2002-06-11 12:13:01 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!bloom-beacon.mit.edu!nycmny1-snh1.gtei.net!crtntx1-snh1.gtei.net!cambridge1-snf1.gtei.net!news.gtei.net!bos-service1.ext.raytheon.com!dfw-service2.ext.raytheon.com.POSTED!not-for-mail Message-ID: <3D064BAB.4040168B@despammed.com> From: Wes Groleau Reply-To: wesgroleau@despammed.com X-Mailer: Mozilla 4.77 [en] (Windows NT 5.0; U) X-Accept-Language: en,es-MX,es,pt,fr-CA,fr MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: Re: Why is memory footprint smaller when compiled static? References: <3D06292A.D1339361@despammed.com> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Date: Tue, 11 Jun 2002 14:12:43 -0500 NNTP-Posting-Host: 151.168.144.162 X-Complaints-To: news@ext.ray.com X-Trace: dfw-service2.ext.raytheon.com 1023822780 151.168.144.162 (Tue, 11 Jun 2002 14:13:00 CDT) NNTP-Posting-Date: Tue, 11 Jun 2002 14:13:00 CDT Organization: Raytheon Company Xref: archiver1.google.com comp.lang.ada:25757 Date: 2002-06-11T14:12:43-05:00 List-Id: > > 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