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=unavailable autolearn_force=no version=3.4.4 Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!news.eternal-september.org!mx02.eternal-september.org!.POSTED!not-for-mail From: Simon Wright Newsgroups: comp.lang.ada Subject: Re: access-to-classwide has non-static size? Date: Fri, 27 Mar 2015 21:11:32 +0000 Organization: A noiseless patient Spider Message-ID: References: <1c04c8e4-9f68-433f-9283-49ba63f70b34@googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: mx02.eternal-september.org; posting-host="e362043f1eec5b72fb571caf32708303"; logging-data="1871"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+FVKjJuknBA3RT1Xg/9yKpFVdynJYDf1Q=" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.4 (darwin) Cancel-Lock: sha1:gLv1oHLxiwEq38OSukI/HCHNp2c= sha1:bIiDJAbTwD0kzpx2eJKnzOlwDtk= Xref: news.eternal-september.org comp.lang.ada:25297 Date: 2015-03-27T21:11:32+00:00 List-Id: sbelmont700@gmail.com writes: > On Friday, March 27, 2015 at 10:18:51 AM UTC-4, Simon Wright wrote: >> >> I've worked out how to do it at elaboration now: >> >> The_Instance_Events : access Event_Queues.Vector := >> new Event_Queues.Vector (Capacity => Capacity); >> >> (compiled but not yet executed - more challenges still to overcome!) > > Don't forget the 2012 'bounded' vector, which I presume would be > acceptable for your situation ("Bounded vector objects should be > implemented without implicit pointers or dynamic allocation.") It is the 2012 bounded vector. There are issues; with Ada.Containers.Bounded_Vectors; package V is new Ada.Containers.Bounded_Vectors (Positive, Some_Access_Type); is treated by GNAT GPL 2014 and FSF GCC 4.9.1 as if it violated No_Implicit_Heap_Allocation (and in fact the generated code does indeed call _gnat_malloc()). GCC 5.0.0 doesn't do this. Still having similar problems with a big object with POs and tasks. You would think that if the compiler was going to generate a .ali which says the unit violates a restriction then it would also generate a warning message, so I guess this is another example of the same bug as above - or similar, anyway.