comp.lang.ada
 help / color / mirror / Atom feed
From: Matthew Heaney <matthew_heaney@acm.org>
Subject: Re: Creation of storage pools
Date: 1999/06/04
Date: 1999-06-04T00:00:00+00:00	[thread overview]
Message-ID: <m36754fral.fsf@mheaney.ni.net> (raw)
In-Reply-To: 374B411C.5EA8@sydney.gecm.com

Graeme Perkes <graeme.perkes@sydney.gecm.com> writes:

> The problem is how to use the storage pools I've created.
> I'm having trouble with  "for XYZ'storage_pool use ..." syntax
> when used with a USER_POOL access variable:
> 
>    STORAGE_POOLS_LIST : POOL_CFG_PTR := null;
> 
>    -- STORAGE_POOLS_LIST is populated by an initialisation procedure
> 
>    MY_POOL : POOL_LIST.POOL_PTR := STORAGE_POOLS_LIST(I);
> 
>    type INT_ACC is access INTEGER;
>    for INT_ACC'storage_pool use MY_POOL.all;
> 
> GNAT 3.11b2 responds with the following error for the use clause:
> 
> 	"incorrect reference to a Storage Pool"
> 
> What am I doing wrong?

Aren't attribute rep clauses static?  You have to bind to a statically
declared storage pool object, not a dynamically declared one.

> What obscure syntax do I need?

  type My_Storage_Pool is new Root_Storage_Pool with ...;

  Storage_Pool : My_Storage_Pool;

  type Integer_Access is access Integer;

  for Integer_Access'Storage_Pool use Storage_Pool;


> Am I trying to violate basic principles of storage pools?

It would appear so.  

See the package System.Pool_Global, in the gnat sources, for an example.







  reply	other threads:[~1999-06-04  0:00 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1999-05-26  0:00 Creation of storage pools Graeme Perkes
1999-06-04  0:00 ` Matthew Heaney [this message]
1999-06-04  0:00   ` Tucker Taft
1999-06-05  0:00 ` Simon Wright
1999-06-07  0:00   ` Graeme Perkes
1999-06-07  0:00     ` adam
replies disabled

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