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 Path: buffer1.nntp.dca1.giganews.com!border1.nntp.dca1.giganews.com!nntp.giganews.com!news.snarked.org!feeder.erje.net!eu.feeder.erje.net!news.stack.nl!aioe.org!.POSTED!not-for-mail From: Pascal Obry Newsgroups: comp.lang.ada Subject: Re: newbie: can't read fast enough... :-) memory leaks... Date: Wed, 03 Sep 2014 12:17:44 +0200 Organization: Home - http://www.obry.net Message-ID: <1409739464.7121.235.camel@obry.net> References: <479b2efe-0238-4b2a-8b05-cb1a0b4a57e5@googlegroups.com> Reply-To: pascal@obry.net NNTP-Posting-Host: rTsBy2wWyKW9R7lucxWs4g.user.speranza.aioe.org Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Complaints-To: abuse@aioe.org X-Mailer: Evolution 3.12.5-1 X-Notice: Filtered by postfilter v. 0.8.2 Xref: number.nntp.dca.giganews.com comp.lang.ada:188828 Date: 2014-09-03T12:17:44+02:00 List-Id: Le mercredi 03 septembre 2014 =C3=A0 02:38 -0700, gdotone@gmail.com a =C3=A9crit :=20 > i know i'll get there, currently in chapter 3, of Ada 95 PSPD, anyway, ca= n Ada code have/produce memory leaks? well, maybe not "can" it but, does A= da, natively prevent memory leaks? >=20 > like, C seems to leak all over the place, if not managed correctly by the= programmer. This depends on the implementation. Ada make it possible to use a garbage collector but as far as I know no implementation is using one. So yes, every Ada compiler around will leak memory if not properly freed. To free an allocated object one need to instantiate Ada.Unchecked_Deallocation. Note that well designed object can deallocate themselves when possible by using Ada.Finalization API. As an example, Unbounded_String are using dynamic allocation but you need need to worry about that as a user. --=20 Pascal Obry / Magny Les Hameaux (78) The best way to travel is by means of imagination http://v2p.fr.eu.org http://www.obry.net gpg --keyserver keys.gnupg.net --recv-key F949BD3B