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.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,83f4a82a69bb9c76 X-Google-Attributes: gid103376,public From: Matthew Heaney Subject: Re: Creation of storage pools Date: 1999/06/04 Message-ID: #1/1 X-Deja-AN: 485555499 References: <374B411C.5EA8@sydney.gecm.com> NNTP-Posting-Date: Thu, 03 Jun 1999 22:44:21 PDT Newsgroups: comp.lang.ada Date: 1999-06-04T00:00:00+00:00 List-Id: Graeme Perkes 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.