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, REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,f6b6181765c24743 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2001-02-05 14:22:55 PST Path: supernews.google.com!sn-xit-02!sn-xit-01!supernews.com!newsfeed.stanford.edu!arclight.uoregon.edu!newsfeed.ksu.edu!nntp.ksu.edu!news.okstate.edu!dvdeug From: dvdeug@x8b4e53cd.dhcp.okstate.edu (David Starner) Newsgroups: comp.lang.ada Subject: Re: Generics - Difference between ADA and Modula--3 Date: 5 Feb 2001 21:46:45 GMT Organization: Oklahoma State University Message-ID: <95n705$9ic1@news.cis.okstate.edu> References: <3a7646fb$1@rsl2.rslnet.net> <956ols$qtv$1@news.cis.ohio-state.edu> <95eumd$8i41@news.cis.okstate.edu> <95n3oi$5nh$1@news.cis.ohio-state.edu> Reply-To: dstarner98@aasaa.ofe.org NNTP-Posting-Host: x8b4e5089.dhcp.okstate.edu User-Agent: slrn/0.9.6.3 (Linux) Xref: supernews.google.com comp.lang.ada:4949 Date: 2001-02-05T21:46:45+00:00 List-Id: On 5 Feb 2001 20:51:30 GMT, Mark Carroll wrote: >In article <95eumd$8i41@news.cis.okstate.edu>, >David Starner wrote: > >>Ada is designed so that it is possible to garbage-collect it. It's >>only garbage-collected on the JVM's, which don't give you any control. >>If there was another GC implementation, any garbage-collection control >>would be implementation-specific. > >That's a pity. So, there aren't any Ada compilers that compile to >native code and offer a runtime with decent GC? Not that I've heard of. I hacked the Boehm-Weiser GC into GNAT's runtime, but GNAT uses some funky virtual base system that makes it crash when running under a garbage collector. I may find the time to do it properly (multilib it, in GCC terms), but at the very least that's going to wait until a version of GNAT depending on the GCC 3.0 build technology comes out. >Are there any other >special tricks used to make memory management easier than, say, a C >programmer might expect? Ada's fairly flexible about stack usage. Occasionally you'll see something like for I in 1 .. 50 loop declare A: array (0 .. I) of Integer; begin ... end; end loop; where there's a varying array. Or alternately: type bob is array (integer range <>) of foo; ... while (complex_condition) loop declare Token: bob := Something_Returning_A_Varying_String; begin ... end; end loop; where you return a varying array. It doesn't catch a lot of stuff that really needs garbage collection, but it catches some of the places where a C program might leak memory. -- David Starner - dstarner98@aasaa.ofe.org Pointless website: http://dvdeug.dhis.org "I don't care if Bill personally has my name and reads my email and laughs at me. In fact, I'd be rather honored." - Joseph_Greg