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,703c4f68db81387d X-Google-Thread: 109fba,703c4f68db81387d X-Google-Thread: 115aec,703c4f68db81387d X-Google-Thread: f43e6,703c4f68db81387d X-Google-Attributes: gid103376,gid109fba,gid115aec,gidf43e6,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news4.google.com!news.glorb.com!border1.nntp.dca.giganews.com!nntp.giganews.com!wn13feed!worldnet.att.net!bgtnsc04-news.ops.worldnet.att.net.POSTED!53ab2750!not-for-mail From: Dave Thompson Newsgroups: comp.lang.ada,comp.lang.c++,comp.realtime,comp.software-eng Subject: Re: [OT] Re: Teaching new tricks to an old dog (C++ -->Ada) Message-ID: References: <4229bad9$0$1019$afc38c87@news.optusnet.com.au> <1110032222.447846.167060@g14g2000cwa.googlegroups.com> <871xau9nlh.fsf@insalien.org> <3SjWd.103128$Vf.3969241@news000.worldonline.dk> <87r7iu85lf.fsf@insalien.org> <1110052142.832650@athnrd02> <1lr611thktbau$.1dj95z21h7l5v.dlg@40tude.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, 28 Mar 2005 06:33:52 GMT NNTP-Posting-Host: 12.75.180.96 X-Complaints-To: abuse@worldnet.att.net X-Trace: bgtnsc04-news.ops.worldnet.att.net 1111991632 12.75.180.96 (Mon, 28 Mar 2005 06:33:52 GMT) NNTP-Posting-Date: Mon, 28 Mar 2005 06:33:52 GMT Organization: AT&T Worldnet Xref: g2news1.google.com comp.lang.ada:10055 comp.lang.c++:47565 comp.realtime:1764 comp.software-eng:5394 Date: 2005-03-28T06:33:52+00:00 List-Id: On 21 Mar 2005 16:00:23 -0500, Robert A Duff wrote: > azdo_b@yahoo.es (Alberto) writes: > > > "Dmitry A. Kazakov" wrote in message news:<1lr611thktbau$.1dj95z21h7l5v.dlg@40tude.net>... > > > 2. C++ is unable to allocate objects of indefinite size on the stack. > > > > Well, we have alloca() for this ;) > > Is alloca part of the C++ standard? I thought not, but I could be > wrong. Anyway, alloca doesn't really do all that Ada can do in this No, nor standard C either. > regard (avoiding heap usage for dynamic-sized things). In this case, > the Ada feature is both more efficient and safer than alloca. > Where available, alloca does allocate on the stack. AFAICS this can do, at a lower/less-safe level, everything Ada can do at function scope. It can't do allocation _and deallocation_ for a block within a function, nor cross-function like function-return-unconstrained. It almost has to be special-cased/inlined so it should be efficient. - David.Thompson1 at worldnet.att.net