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=unavailable autolearn_force=no version=3.4.4 X-Received: by 10.224.171.72 with SMTP id g8mr86107qaz.7.1376327664112; Mon, 12 Aug 2013 10:14:24 -0700 (PDT) X-Received: by 10.50.3.70 with SMTP id a6mr761668iga.16.1376327664058; Mon, 12 Aug 2013 10:14:24 -0700 (PDT) Path: border1.nntp.ams.giganews.com!nntp.giganews.com!feeder2.cambriumusenet.nl!feed.tweaknews.nl!209.197.12.246.MISMATCH!nx02.iad01.newshosting.com!newshosting.com!69.16.185.11.MISMATCH!npeer01.iad.highwinds-media.com!news.highwinds-media.com!feed-me.highwinds-media.com!f7no2046084qan.0!news-out.google.com!he10ni1415qab.0!nntp.google.com!fx3no2144232qab.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail Newsgroups: comp.lang.ada Date: Mon, 12 Aug 2013 10:14:23 -0700 (PDT) In-Reply-To: <90b5c304-417e-4303-931c-e86d34e17541@googlegroups.com> Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=66.126.103.122; posting-account=RxNzCgoAAACA5KmgtFQuaU-WaH7rjnAO NNTP-Posting-Host: 66.126.103.122 References: <90b5c304-417e-4303-931c-e86d34e17541@googlegroups.com> User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: Subject: Re: Questions on Storage Pools From: Adam Beneschan Injection-Date: Mon, 12 Aug 2013 17:14:24 +0000 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Received-Bytes: 4306 Xref: number.nntp.dca.giganews.com comp.lang.ada:182982 Date: 2013-08-12T10:14:23-07:00 List-Id: I think you're confusing "finalization" with "storage reclamation". They'r= e not the same thing. Finalization mostly means calling Finalize routines = on an object and its subcomponents, where they exist; there are extra actio= ns for protected types. Finalization doesn't even have to involve any free= ing of storage. If a Finalize routine does free storage, it would normally= do so with Unchecked_Deallocation. But it wouldn't deallocate the object = being finalized, since Finalize's parameter is the object itself as an IN O= UT parameter, not an access to the object. =20 An access type can have a Storage_Size clause, or it can have a Storage_Poo= l clause. It cannot have both (13.11(3)). If it has a Storage_Size clause= , the intent is that some block of memory (whose size is Storage_Size plus = possibly a little extra) is set aside, and all "new" operations that return= the access type use memory in that block for the new object. If the objec= t contains accesses to other objects (of a different access type), those ac= cessed objects wouldn't be in the same block. It would make sense for a Fi= nalize procedure to deallocate those accessed objects, but that wouldn't af= fect what happens in the block of size Storage_Size. If there's still something that isn't clear, I'll try to answer. -- Adam =20 On Saturday, August 10, 2013 2:45:20 PM UTC-7, AdaMagica wrote: > This is a question to language lawyers. >=20 > First two citations: >=20 > RM 13.11(18) If Storage_Size is specified for an access type, then the St= orage_Size of this pool is at least that requested, and the storage for the= pool is reclaimed when the master containing the declaration of the access= type is left. >=20 >=20 >=20 > RM 7.6.1(11.1/3) Each nonderived access type T has an associated *collect= ion*, which is the set of objects created by allocators of T ... Finalizati= on of a collection consists of finalization of each object in the collectio= n, in an arbitrary order. The collection of an access type is an object imp= licitly declared at the following place: >=20 > (11.2/3) For a named access type, the first freezing point (see 13.14) of= the type. >=20 >=20 >=20 > So, IIUC 7.6.1, if the master of an access type is left, all still existi= ng objects in the collection are finalized. (Note that these paragraphs and= the definition of *collection* are new in Ada 2012.) >=20 > However 13.11 seems to say that this is the case only for access types wi= th Storage_Size defined. >=20 > Further: If several access types use the same (user defined) storage pool= , and the master of one of them is left (i.e. this access type has a deeper= access level than the others and also deeper than the storage pool itself)= , is then the associated collection (i.e. a part of all objects allocated i= n the storage pool) finalized? >=20 > In other words: Is the collection of an access type with a defined storag= e pool part of this pool and finalized separately? >=20 > I would be very thankful for clarification. >=20 > C. Grein