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-Thread: 103376,7aeecd1069c28415 X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news4.google.com!news.glorb.com!wn14feed!worldnet.att.net!bgtnsc05-news.ops.worldnet.att.net.POSTED!53ab2750!not-for-mail From: Dave Thompson Newsgroups: comp.lang.ada Subject: Re: Objects and the Stack? Message-ID: <513vs0945us1jteq10iidp53vher0tpuiq@4ax.com> References: <32fv82F3l9al7U1@individual.net> X-Newsreader: Forte Agent 1.93/32.576 English (American) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Date: Mon, 27 Dec 2004 04:34:19 GMT NNTP-Posting-Host: 12.76.19.129 X-Complaints-To: abuse@worldnet.att.net X-Trace: bgtnsc05-news.ops.worldnet.att.net 1104122059 12.76.19.129 (Mon, 27 Dec 2004 04:34:19 GMT) NNTP-Posting-Date: Mon, 27 Dec 2004 04:34:19 GMT Organization: AT&T Worldnet Xref: g2news1.google.com comp.lang.ada:7223 Date: 2004-12-27T04:34:19+00:00 List-Id: On Sat, 18 Dec 2004 14:41:33 -0500, "Warren W. Gay VE3WWG" wrote: > Nick Roberts wrote: > > Ada has no equivalent of alloca() in C. It might be interesting to > > experiment with a compiler extension to provide this facility. Certain > > algorithms might benefit from it. > > The difference between what alloca() gets you and what you > get in the declare block is a minor difference: > Agree. > > declare > > Name: String := ""; > > pragma Extensible_Object(Name); > > begin > > ... > > Name := Name & ':'; -- changes its size > > ... > > > > It's an idea. > > This is taking the alloca() idea further than I think it > goes. I could be wrong here, but can you realloc() an > alloca() region? If so, that is something that Ada does No. But, if you alloca() multiple times, with nothing intervening, you can probably count on them being contiguous, although probably (on nearly all machines) in reverse order and maybe not exactly the size requested, and AFAICS (even) that's not formally guaranteed. > in fact lack (including a realloc() in general, which I > pine for when growing arrays). > - David.Thompson1 at worldnet.att.net