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 From: "Randy Brukardt" Newsgroups: comp.lang.ada Subject: Re: Use aggregates (Was: Allocation question) Date: Wed, 13 May 2009 15:38:27 -0500 Organization: Jacob Sparre Andersen Message-ID: References: <4a07fc7a$0$2855$ba620e4c@news.skynet.be> <87prefhq04.fsf@nbi.dk> <62aa80a1-1c0b-4716-ab16-9b6243d97ff2@o27g2000vbd.googlegroups.com> <26af755b-0b90-429f-a688-86bf307da2b5@o20g2000vbh.googlegroups.com> <7b4408e9-386d-471b-aad5-9d26dde12682@v17g2000vbb.googlegroups.com> NNTP-Posting-Host: static-69-95-181-76.mad.choiceone.net X-Trace: munin.nbi.dk 1242247121 18700 69.95.181.76 (13 May 2009 20:38:41 GMT) X-Complaints-To: news@jacob-sparre.dk NNTP-Posting-Date: Wed, 13 May 2009 20:38:41 +0000 (UTC) X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2900.5512 X-RFC2646: Format=Flowed; Original X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.5579 Path: g2news2.google.com!news4.google.com!proxad.net!feeder1-2.proxad.net!feed.ac-versailles.fr!news.ecp.fr!news.jacob-sparre.dk!pnx.dk!not-for-mail Xref: g2news2.google.com comp.lang.ada:5828 Date: 2009-05-13T15:38:27-05:00 List-Id: >"Martin" wrote in message >news:7b4408e9-386d-471b-aad5-9d26dde12682@v17g2000vbb.googlegroups.com... >On May 12, 10:18 pm, "Randy Brukardt" wrote: >> "Martin" wrote in message >> >> news:26af755b-0b90-429f-a688-86bf307da2b5@o20g2000vbh.googlegroups.com... >> >> >> This is not always a good idea. On some targets, GNAT places the >> >> aggregate on the stack and this can raise a Storage_Error. In avionics >> >> programs, I remember replacing aggregates with loops for this reason. >> >> >And not just GNAT...in fact, I'm struggling to remember a compiler >> >that _doesn't_ do the "large and slow (and stupid?)" aggregate for >> >assignment (or initialisation). >> >> You must have not used many Ada compilers. > >The current count is 7 (for my day job) + 3 (for home work). Fascinating. I'd be interested in seeing an example where you are seeing compilers that are doing "large and slow" aggregate initialization or assignment, because I have to think we are talking about different things. Randy.