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,b99897135d6631cc X-Google-Attributes: gid103376,public Path: g2news1.google.com!news1.google.com!news.glorb.com!newsfeed00.sul.t-online.de!newsmm00.sul.t-online.de!t-online.de!news.t-online.com!not-for-mail From: Martin Krischik Newsgroups: comp.lang.ada Subject: Re: memory management and productivity Date: Mon, 21 Jun 2004 10:14:51 +0200 Organization: AdaCL Message-ID: <1848444.QBUeL21EQ8@linux1.krischik.com> References: <40d15023$1_1@baen1673807.greenlnk.net> <2jnh22F12nvieU2@uni-berlin.de> Reply-To: krischik@users.sourceforge.net Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7Bit X-Trace: news.t-online.com 1087805762 03 14026 x3UbXZm1NmhLSd2Y 040621 08:16:02 X-Complaints-To: usenet-abuse@t-online.de X-ID: SIiGF+ZFQeZUqB0BtniAX5ewpjMltkTivD3D29QvBV7xFNYm1luC8v User-Agent: KNode/0.7.7 Xref: g2news1.google.com comp.lang.ada:1729 Date: 2004-06-21T10:14:51+02:00 List-Id: Jano wrote: > It's been so many time since I did C++ that I may be wrong, correct me > in that case. > > IIRC, in C++ you must destroy (delete?) the object to get the destructor > called. So, even if you have a carefully built chain of destructors, if > at some point you forget to destroy the root, you're leaking. > > In Ada, when an object goes out of scope (assuming it has been created > in the stack and not with the "new" operator), it's automatically > finished so you have one less thing to care about. It is the same in Ada as in C++. Both can create object on the heap on stack. The real difference is that Ada has indefinite objects and as a result far less object need to be created on the heap. For example C++ std::vector<> can't store polymorvic objects - Ada soon to come Ada.Containers.Indefinite_Vectors can. With Regards Martin Container Libraries with support for indefinite Object: Booch Components: http://adacl.sf.net Ada.Containers: http://charles.tigris.org. -- mailto://krischik@users.sourceforge.net http://www.ada.krischik.com