Article View: comp.lang.c.moderated
Article #2186Re: Bad Style Contest - We Have a Winner!
From: Konrad Schwarz
Date: Thu, 07 Mar 1996 00:24
Date: Thu, 07 Mar 1996 00:24
23 lines
1474 bytes
1474 bytes
In article <4hgc5l$99s@solutions.solon.com>, stanr@tiac.net (Stan Ryckman) writes: [alloca is horrible] |> [I agree. alloca is deranged, undesireable, and useful only when there's |> a problem with the design of the code to begin with. The sole excuse |> for it would go away if the committee introduced variable-sized arrays |> and added C++ style mixing of declarations with code. -mod] I disaagree. Where applicable, alloca gives you garbage-collected dynamic memory for free, so it's a programming and a run-time win. Variable-sized arrays are not the only use of alloca and cannot supplant it. As far as I know, implementing alloca via the stack is trivial on any general-purpose CPU, but I am interested in hearing of counter examples. [The botch is that the stack is expensive, and some machines, such as the Amiga, dislike it when programs allocate vast objects on the stack. -mod] Konrad Schwarz
Technical Details
Message-ID:
<4hlacp$4bg@solutions.solon.com>Path:
arc1-ca.pugleaf.net!solon.com!not-for-mailReferences:
<4fjmdt$og4@solutions.solon.com> <4g27nn$qaj@solutions.solon.com> <4h2thl$1io@solutions.solon.com> <4hgc5l$99s@solutions.solon.com>Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!solon.com!not-for-mail From: schwarz@a2.complang.tuwien.ac.at (Konrad Schwarz) Newsgroups: comp.lang.c.moderated Subject: Re: Bad Style Contest - We Have a Winner! Date: 6 Mar 1996 18:24:57 -0600 Organization: TU Wien Sender: clc@solutions.solon.com Approved: clc@solutions.solon.com Message-ID: <4hlacp$4bg@solutions.solon.com> References: <4fjmdt$og4@solutions.solon.com> <4g27nn$qaj@solutions.solon.com> <4h2thl$1io@solutions.solon.com> <4hgc5l$99s@solutions.solon.com> NNTP-Posting-Host: solutions.solon.com