comp.lang.ada
 help / color / mirror / Atom feed
From: ytomino <aghia05@gmail.com>
Subject: Is Storage Subpool Example tested?
Date: Wed, 25 Apr 2012 14:18:14 -0700 (PDT)
Date: 2012-04-25T14:18:14-07:00	[thread overview]
Message-ID: <17281761.1787.1335388694731.JavaMail.geo-discussion-forums@pbcrp8> (raw)

Hello.

I'm trying to compile http://ada-auth.org/standards/12rm/html/RM-13-11-6.html , but there are some errors.

Perhaps, 

1. "use type System.Storage_Pools.Subpools.Subpool_Handle;" is missing.

2. 2nd parameter of Set_Pool_of_Subpool is "in out", but access value is given.

3. Downcast as MR_Subpool is missing in
> Result.Start := Pool.Next_Allocation;

4. ".Start" is missing in
> Pool.Next_Allocation := Pool.Markers(Pool.Current_Pool);

(And, I had to replace some 'Unchecked_Access to 'Unrestricted_Access, but this is GNAT's feature. I don't care it.)

BTW, Do you have a interesting idea to use subpools?
For instance, I like Matthew Heaney's System.Initialization. ( http://www.ada-auth.org/cgi-bin/cvsweb.cgi/ai05s/ai05-0001-1.txt?rev=1.17 )
It seems to be able to implement by user with subpool.

 P := System.Initialization.New_Object (Storage);

is able to be rewritten like below

 P := new (Make_Subpool_Using_Given_Address (Storage'Address)) Object_Type;

However, Delete_Object is difficult. :-)



             reply	other threads:[~2012-04-25 21:43 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-04-25 21:18 ytomino [this message]
2012-04-26  3:03 ` Is Storage Subpool Example tested? Randy Brukardt
2012-04-26  4:37   ` ytomino
2012-04-27  0:32     ` Randy Brukardt
2012-04-27  7:56       ` ytomino
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox