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: Tucker Taft Subject: Re: Creation of storage pools Date: 1999/06/04 Message-ID: <3758101E.60CD9E18@averstar.com>#1/1 X-Deja-AN: 485743885 Content-Transfer-Encoding: 7bit Sender: news@inmet.camb.inmet.com (USENET news) X-Nntp-Posting-Host: houdini.burl.averstar.com References: <374B411C.5EA8@sydney.gecm.com> Content-Type: text/plain; charset=us-ascii Organization: AverStar (formerly Intermetrics) Burlington, MA USA Mime-Version: 1.0 Newsgroups: comp.lang.ada Date: 1999-06-04T00:00:00+00:00 List-Id: Matthew Heaney wrote: > > 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? Not all of them. Clearly those that require that the expression denote a variable can't require that it be a static expression. > ... You have to bind to a statically > declared storage pool object, not a dynamically declared one. Not necessarily true in this case, though conceivably GNAT may have such a restriction. The only hard requirement is that the storage pool object denoted be a variable (see RM95 13.11(15)). > ... > > Am I trying to violate basic principles of storage pools? > > It would appear so. No, you are not violating any basic principle. Conceivably GNAT has a restriction (or bug) in this area. > See the package System.Pool_Global, in the gnat sources, for an example. -- -Tucker Taft stt@averstar.com http://www.averstar.com/~stt/ Technical Director, Distributed IT Solutions (www.averstar.com/tools) AverStar (formerly Intermetrics, Inc.) Burlington, MA USA