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.2 required=5.0 tests=BAYES_00,INVALID_MSGID, REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,ed6a891101ff4e06 X-Google-Attributes: gid103376,public From: kilgallen@eisner.decus.org (Larry Kilgallen) Subject: Re: Freeing Pointers to classwide types Date: 1998/10/02 Message-ID: <1998Oct2.123113.1@eisner>#1/1 X-Deja-AN: 397089472 X-Nntp-Posting-Host: eisner.decus.org References: <3613a5b1.186262@SantaClara01.news.InterNex.Net> <6v15di$87t$1@nnrp1.dejanews.com> X-Trace: news.decus.org 907345876 3346 KILGALLEN [192.67.173.2] Organization: LJK Software Reply-To: Kilgallen@eisner.decus.org.nospam Newsgroups: comp.lang.ada Date: 1998-10-02T00:00:00+00:00 List-Id: In article <6v15di$87t$1@nnrp1.dejanews.com>, dewarr@my-dejanews.com writes: > In article , > stt@houdini.camb.inmet.com (Tucker Taft) wrote: >> Tom Moran (tmoran@bix.com) wrote: >> >> : ... >> : Let me rephrase the question: If an access type goes out of scope, >> : so the things it pointed to become inaccessible, is there any portable >> : way to prevent an eventual Storage_Error from multiple calls of the >> : block, without using Unchecked_Deallocation? >> >> Yes. Specify the 'Storage_Size associated with the access-type. >> The implementation is required to reclaim the storage for the >> access type when exiting its scope if a 'Storage_Size is specified >> (see RM95 13.11(18)). > > > Yes, indeed! Nice answer, but I was assuming that this obvious approach of > fixed size allocation was not acceptable, in which case you are definitely > going to have to use UD I am afraid :-) Is it common for implementations to allocate the maximum size when the type is elaborated ? I had presumed the maximum would just be a limit beyond which the total of one-at-a-time allocations would not proceed. In that case I figured from the discussion that setting Storage_Size to MAX_INT (never intending to get there) would accomplish the deallocation purpose. Larry Kilgallen