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,FREEMAIL_FROM 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 10:01:04 PST Path: archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-01!supernews.com!mtu.ru!news.rosnet.ru!newsfeed.rt.ru!newsfeed.online.be!zur.uu.net!ash.uu.net!spool0900.news.uu.net!reader0901.news.uu.net!not-for-mail Message-ID: <3C923755.7050007@mail.com> Date: Fri, 15 Mar 2002 13:03:01 -0500 From: Hyman Rosen User-Agent: Mozilla/5.0 (Windows; U; WinNT4.0; en-US; rv:0.9.9) Gecko/20020311 X-Accept-Language: en-us, en MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: Re: memory leakages with Ada? References: <3c90af1e@news.starhub.net.sg> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Organization: KBC Financial Products Cache-Post-Path: master.nyc.kbcfp.com!unknown@mosquito.nyc.kbcfp.com X-Cache: nntpcache 2.3.3 (see http://www.nntpcache.org/) NNTP-Posting-Host: 204.253.250.10 X-Trace: 1016215261 reader1.ash.ops.us.uu.net 1909 204.253.250.10 Xref: archiver1.google.com comp.lang.ada:21302 Date: 2002-03-15T13:03:01-05:00 List-Id: Kevin Cline wrote: > No problem in C++ though: > nbBytes = GetNbBytes( dataSource ); > std::vector data(nbBytes); > GetData( data ); But this is identical in spirit to the C version, in that memory will be allocated from the heap instead of the stack. The Ada version requires no deallocation or destruction other than that afforded by exiting the scope of the object.