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-Thread: 103376,147f221051e5a63d X-Google-Attributes: gid103376,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII Path: g2news1.google.com!news3.google.com!proxad.net!feeder1-2.proxad.net!193.252.118.146.MISMATCH!news.wanadoo.fr!news.wanadoo.fr!not-for-mail Message-ID: <482E8A9D.5040401@obry.net> Date: Sat, 17 May 2008 09:34:53 +0200 From: Pascal Obry Organization: Home - http://www.obry.net User-Agent: Thunderbird 2.0.0.14 (Windows/20080421) MIME-Version: 1.0 Newsgroups: comp.lang.ada To: "jhc0033@gmail.com" Subject: Re: memory management in Ada: tedious without GC? References: <4ddef8bf-b5b1-4d7e-b75b-386cd6c8402c@l17g2000pri.googlegroups.com> In-Reply-To: <4ddef8bf-b5b1-4d7e-b75b-386cd6c8402c@l17g2000pri.googlegroups.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 8bit NNTP-Posting-Date: 17 May 2008 09:34:56 CEST NNTP-Posting-Host: 83.199.98.24 X-Trace: 1211009696 news.orange.fr 881 83.199.98.24:1715 X-Complaints-To: abuse@orange.fr Xref: g2news1.google.com comp.lang.ada:142 Date: 2008-05-17T09:34:56+02:00 List-Id: jhc0033@gmail.com a �crit : > Did I misunderstand? You have already received a bunch of excellent answers. I'd like to point out that in Ada you have less need for dynamically allocated memory. Ada supports unconstraint types. Objects of such types when declared can be "allocated" on the stack and passed around (no heap usage). A simple example: type Vector is (Positive range <>) of Float; function Norm (V : in Vector) return Float; ... declare V : Vector (1 .. 100); R : Float; begin R := Norm (V); ... Not a single memory allocation. In C/C++ you'll need to dynamically allocate V on the heap, and then worry about freeing this memory. Pascal. -- --|------------------------------------------------------ --| Pascal Obry Team-Ada Member --| 45, rue Gabriel Peri - 78114 Magny Les Hameaux FRANCE --|------------------------------------------------------ --| http://www.obry.net --| "The best way to travel is by means of imagination" --| --| gpg --keyserver wwwkeys.pgp.net --recv-key C1082595