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=-0.4 required=5.0 tests=AC_FROM_MANY_DOTS,BAYES_00 autolearn=no autolearn_force=no version=3.4.4 X-Google-Thread: 103376,5117b1b6391a0e06 X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news1.google.com!news.glorb.com!border1.nntp.dca.giganews.com!border2.nntp.dca.giganews.com!nntp.giganews.com!cyclone1.gnilink.net!spamkiller2.gnilink.net!gnilink.net!nwrdny02.gnilink.net.POSTED!0f19ed38!not-for-mail From: "Frank J. Lhota" Newsgroups: comp.lang.ada References: <1087410710.477506@master.nyc.kbcfp.com> <8yXCc.548$Av3.500@nwrdny01.gnilink.net> Subject: Re: A simple ADA puzzle (I haven't the answer) X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2800.1409 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1409 Message-ID: Date: Fri, 25 Jun 2004 19:23:13 GMT NNTP-Posting-Host: 151.203.203.234 X-Complaints-To: abuse@verizon.net X-Trace: nwrdny02.gnilink.net 1088191393 151.203.203.234 (Fri, 25 Jun 2004 15:23:13 EDT) NNTP-Posting-Date: Fri, 25 Jun 2004 15:23:13 EDT Xref: g2news1.google.com comp.lang.ada:1898 Date: 2004-06-25T19:23:13+00:00 List-Id: "Bob Spooner" wrote in message news:cbhq5o$bne$1@f04n12.cac.psu.edu... > There is another case that isn't being considered here. When doing real-time > programming, I consider implicit use of the heap a _bad thing_ because the > amout of time it takes to do the allocation is not deterministic. Would you consider it acceptable if implicit allocation could be controlled by a pragma and / or compiler option? A compiler with such a pragma / option would give us the best of both worlds, allowing the programmer to either allow the compiler to choose the best option or to make that choice herself/himself. > If I want > something to be allocated on the heap, I will say so explicitly. I do not > want a compiler that silently does something I didn't ask for. I am quite sympathetic to that point of view. The problem, as indicated in my previous post, is that for some types, the choice of whether one wants to use the stack for these object is platform-specific. How does one code such types in a portable way without allowing the compiler to choose the memory allocation strategy? As noted before, pragmas and / or compiler options could be used to override the compiler's default choice. Is there a downside to this scheme? Is there an alternative scheme that would provide us with as much portability?