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,345a8b767542016e X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2002-03-15 09:41:00 PST Path: archiver1.google.com!postnews1.google.com!not-for-mail From: kcline@optelnow.net (Kevin Cline) Newsgroups: comp.lang.ada Subject: Re: memory leakages with Ada? Date: 15 Mar 2002 09:41:00 -0800 Organization: http://groups.google.com/ Message-ID: References: <3c90af1e@news.starhub.net.sg> NNTP-Posting-Host: 198.23.5.11 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit X-Trace: posting.google.com 1016214060 20684 127.0.0.1 (15 Mar 2002 17:41:00 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: 15 Mar 2002 17:41:00 GMT Xref: archiver1.google.com comp.lang.ada:21299 Date: 2002-03-15T17:41:00+00:00 List-Id: "Marin David Condic" wrote in message news:... > In comparing Ada to C on this there are two observations: One is that Ada > provides a different model for dynamic allocation than does C that includes, > among other things, a lot more checks/safety features to minimize the > possibility of lost memory. (Still, the standard doesn't require garbage > collection so you can still leak memory if you mess things up.) It isn't > impossible to leak memory in Ada - just less likely. > > The other thing is that stylistically, Ada tends to do things off of the > stack or global memory rather than require lots of dynamic allocation. Short > of building your own linked data structures, you generally almost *never* > create things via dynamic allocation. (Constrast this with C where you > routinely do dynamic allocation of strings or structs and routinely manage > pointers to all sorts of things.) If you find you are constantly dynamically > allocating things in your Ada programs, you are probably not doing it The > Ada Way (trying to translate C into Ada?) and need to rethink what you're > doing. So dynamic memory allocation is no problem in Ada because "we just don't do that?" That's fine for embedded applications, but the users of desktop applications expect them to consume memory proprotional to the data set size. They aren't too happy with messages like "sorry, file too large, please increase DATA_FILE.MAX_SIZE and recompile."