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=-1.9 required=5.0 tests=BAYES_00 autolearn=ham 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 14:38:21 PST Path: archiver1.google.com!news1.google.com!sn-xit-02!sn-post-01!supernews.com!corp.supernews.com!not-for-mail From: "Randy Brukardt" Newsgroups: comp.lang.ada Subject: Re: Why is memory footprint smaller when compiled static? Date: Tue, 11 Jun 2002 16:38:00 -0500 Organization: Posted via Supernews, http://www.supernews.com Message-ID: References: <3D06292A.D1339361@despammed.com> <3D064BAB.4040168B@despammed.com> X-Newsreader: Microsoft Outlook Express 4.72.3612.1700 X-MimeOLE: Produced By Microsoft MimeOLE V4.72.3719.2500 X-Complaints-To: newsabuse@supernews.com Xref: archiver1.google.com comp.lang.ada:25764 Date: 2002-06-11T16:38:00-05:00 List-Id: Wes Groleau wrote in message <3D064BAB.4040168B@despammed.com>... > >> > 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 :-) > >... (examples omitted) >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. But the problems reappear if these are intended to be extensible types with overridable operations. Claw is designed much as you suggest, so that you don't drag in control and window types that you don't use. But you do drag in all of the functionality for control and window types that you do use, as everything has to be declared in a single package to support extensibility and overridability. That means that unused subprogram elimination is very valuable. (Its also useful when using the standard Ada libraries, which are not factored very well. The original reason we implemented it was the huge size (by 1985 standards) of Text_IO.) Randy.