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-Thread: a07f3367d7,bb7708f0d606e785 X-Google-Attributes: gida07f3367d7,public,usenet X-Google-NewGroupId: yes X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news4.google.com!proxad.net!feeder1-2.proxad.net!newsfeed.straub-nv.de!news.ett.com.ua!not-for-mail From: "Jeffrey R. Carter" Newsgroups: comp.lang.ada Subject: Re: Deallocation of Unbounded_String Date: Sat, 25 Jul 2009 12:17:45 -0700 Organization: ETT newsserver Message-ID: References: NNTP-Posting-Host: 28.sub-75-209-119.myvzw.com Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Complaints-To: usenet@news.ett.com.ua X-Notice: Filtered by postfilter v. 0.6.1 User-Agent: Thunderbird 2.0.0.22 (Windows/20090605) Xref: g2news1.google.com comp.lang.ada:6382 Date: 2009-07-25T12:17:45-07:00 List-Id: vlc wrote: > > when using Unbounded_String, is it necessary to deallocate instances > of Unbounded_String after use or is there a kind of garbage collector > implemented? The "Implementation Requirements" of ARM A.4.5(88) say, "No storage associated with an Unbounded_String object shall be lost upon assignment or scope exit." This means the user doesn't have to worry about it; objects of the type take care of their own memory management. [ARM A.4.5(72.1/2, "The type Unbounded_String needs finalization (see 7.6)," gives you a clue about how this is probably done.] > There is a "Free" function in Ada.Strings.Unbounded, but it takes an > access to String as argument, not an access to Unbounded_String. That and the type String_Access have nothing to do with Unbounded_String, and really shouldn't be there. The likely explanation for them is that implementations were expected to use access-to-String, and it was thought that these declarations would be generally useful. Even then, they would be better off in Ada.Strings than in Ada.Strings.Unbounded. -- Jeff Carter "If a sperm is wasted, God gets quite irate." Monty Python's the Meaning of Life 56