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.4 required=5.0 tests=AC_FROM_MANY_DOTS,BAYES_00 autolearn=no 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-21 08:16:14 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!canoe.uoregon.edu!arclight.uoregon.edu!fr.usenet-edu.net!usenet-edu.net!fr.clara.net!heighliner.fr.clara.net!news-x2.support.nl!psinet-eu-nl!psiuk-p4!uknet!psiuk-p3!uknet!psiuk-n!news.pace.co.uk!nh.pace.co.uk!not-for-mail From: "Marin David Condic" Newsgroups: comp.lang.ada Subject: Re: memory leakages with Ada? Date: Wed, 20 Mar 2002 12:48:12 -0500 Organization: Posted on a server owned by Pace Micro Technology plc Message-ID: References: <3c90af1e@news.starhub.net.sg> <3c91bfa3.1987537@news.demon.co.uk> <3C9629E3.8030109@home.com> <3C9645DD.4020006@mail.com> <3C9659B6.6030204@mail.com> <3C97E496.20404@mail.com> NNTP-Posting-Host: dhcp-200-133.miami.pace.co.uk X-Trace: nh.pace.co.uk 1016646494 10010 136.170.200.133 (20 Mar 2002 17:48:14 GMT) X-Complaints-To: newsmaster@news.cam.pace.co.uk NNTP-Posting-Date: 20 Mar 2002 17:48:14 GMT X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 5.50.4522.1200 X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4522.1200 Xref: archiver1.google.com comp.lang.ada:21514 Date: 2002-03-20T17:48:14+00:00 List-Id: Well, yeah, that's true. A function returning a String would need to construct the string then copy it to the caller's space. C's allocation and return of a pointer doesn't require that. Note that you *can* do the same in Ada - you just aren't *forced* to do that. Hence, if your application isn't time-critical or memory-critical, you don't have to take the risk of memory leaks by doing so. MDC -- Marin David Condic Senior Software Engineer Pace Micro Technology Americas www.pacemicro.com Enabling the digital revolution e-Mail: marin.condic@pacemicro.com "Hyman Rosen" wrote in message news:3C97E496.20404@mail.com... > > Yes, that's exactly what I was trying to say! > My point was that in the various C techniques, > the bytes of the result get constructed once, > and then don't have to be copied as part of > the function return, whereas returning a String > in Ada will involve copying the bytes. >