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: Containers on small systems (Was: GNAT GPL is not shareware) Date: Sun, 01 Feb 2015 21:17:55 +0000 Organization: A noiseless patient Spider Message-ID: References: <0Kgqw.953330$_k.685364@fx16.iad> <199c826a-923e-497f-a8e2-9e732c8a5665@googlegroups.com> <87bnmetex4.fsf@ludovic-brenta.org> <4ae7f0d5-d681-4be9-95bc-b5e789b3ad40@googlegroups.com> <87tx06rve6.fsf@ludovic-brenta.org> <87lhlirpk0.fsf@ludovic-brenta.org> <724c149f-0396-42a4-8594-bdbf21cce0d9@googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: mx02.eternal-september.org; posting-host="8cd79d7ffa75567f93d907bdfb272368"; logging-data="10272"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18sr7XUEhjvd/tkWVWiPgD/0k9w/GNhUEs=" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.4 (darwin) Cancel-Lock: sha1:m1HBknSwnDMxCqD4C34OgH2vodo= sha1://wcDLoZ/uY0rZrSpwl0GrUN36E= Xref: news.eternal-september.org comp.lang.ada:24837 Date: 2015-02-01T21:17:55+00:00 List-Id: "Randy Brukardt" writes: > "Simon Wright" wrote in message > news:lylhkkcdec.fsf@pushface.org... > ... >> I can't at the moment include Ada.Containers.* in my STM32F4 RTS, >> because I don't support memory allocation, > > The bounded containers shouldn't require any allocation; there is > Implementation Advice to avoid that. > > If there is an issue, it's probably with finalization. The containers > themselves aren't supposed to use finalization, but its likely that > the iterators and references do. > >> and AdaCore don't include any >> Containers in their Ravenscar RTSs for the same board, and I only have >> 192K of RAM to play with! but if I did, I'd use the FSF version. > > A bounded container is only as big as you need it to be. (Well, unless > the compiler is doing something unfriendly.) Not having bounded > containers is pretty much like not having arrays, IMHO. Of course this is just GNAT, but the amount of support software required to support their Containers (called in by finalization, exception propagation, dispatching, streams ...) is large. I see AARM A.18.19(6.a) indicates that Iterator and Reference types could be left out in restricted environments (so no "for A of B loop ..."?), which would eliminate the need for finalization and dispatching .. maybe something can be done. What does C++ typically provide for small boards? The full STL? a subset? [1] http://www.ada-auth.org/standards/12aarm/html/AA-A-18-19.html#p6.a