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 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,52d73309a1322d28,start X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2003-05-31 13:23:23 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!newsswitch.lcs.mit.edu!nntp.TheWorld.com!not-for-mail From: Robert A Duff Newsgroups: comp.lang.ada Subject: Re: Q:Usage of storage Pools Date: 31 May 2003 16:23:20 -0400 Organization: The World Public Access UNIX, Brookline, MA Message-ID: References: NNTP-Posting-Host: shell01.theworld.com Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: pcls4.std.com 1054412600 19142 199.172.62.241 (31 May 2003 20:23:20 GMT) X-Complaints-To: abuse@TheWorld.com NNTP-Posting-Date: Sat, 31 May 2003 20:23:20 +0000 (UTC) User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.2 Xref: archiver1.google.com comp.lang.ada:38241 Date: 2003-05-31T16:23:20-04:00 List-Id: Michael Erdmann writes: > Hallo all, > > i am trying to use storage pools, and i have come to a blocking > point. The construct below failes to compile with GNAT: > > with Pool; > > package List is > > type List_Element_Type; > type List_Element_Access is access List_Element_Type; > > type List_Element_Type is record > Next : List_Element_Access := null; > end record; > > package Element_Pool is new Pool( Pool_Data_Type => List_Element_Type ); > > Storage : Element_Pool.Object; > for List_Element_Access'Storage_Pool use Storage; > > end List; > > with the error > > gnatmake test.adb -o testx > gcc -c test.adb > list.ads:12:04: warning: no more representation items for type > "List_Element_Access" defined at line 6 > list.ads:15:04: representation item appears too late > gnatmake: "test.adb" compilation error > > I have played arround with various locations of the for statement > but is does not help. You can't put the "for..." after a generic instantiation. You can't put it before the instantiation, since it refers to the instance. Why do you want to pass the type into the pool generic like that? To know its size and alignment? You might be able to pass this info to the pool as discriminants, instead. - Bob