🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: gnu.misc.discuss
Article #75704

Why alloca()?

#75704
From: Eric Schnoebelen
Date: Sat, 19 May 1990 04:42
20 lines
1475 bytes
I'm curious why (it seems like) all the gnu products seem to insist upon
using the alloca() function?  I was under the impression that it was
generally considered a vile, disgusting function and was generally
considered bad form to use it.

Case in point.  I recently ported gdbm1.1 to System V R3.2.  The source
initially used alloca() in several places.  In doing so, it required me
to link in an additional library, that wouldn't obviously needed
normally.

With a little careful study, I was able to replace all occurrences of
alloca() with calls to malloc() and free().  This process took perhaps
an hour.  Why couldn't the original programmer have done this, and
created a much more portable program?

Thank you for your indulgence.
-- 
Eric Schnoebelen		eric@cirr.com		 schnoebe@convex.com
	Real Programmers never work 9 to 5.  If any real programmers
	    are around at 9am it's because they were up all night.
Technical Details
Message-ID: <1990May19.044239.16031@egsner.cirr.com>
Path: arc1-ca.pugleaf.net!gmdzi!unido!mcsun!uunet!cs.utexas.edu!texbell!vector!egsner!eric

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 1025b4,57cdf436494e0ba9,start
X-Google-Attributes: gid1025b4,public
X-Google-ArrivalTime: 1990-05-19 12:06:09 PST
Path: arc1-ca.pugleaf.net!gmdzi!unido!mcsun!uunet!cs.utexas.edu!texbell!vector!egsner!eric
From: eric@egsner.cirr.com (Eric Schnoebelen)
Newsgroups: gnu.misc.discuss
Subject: Why alloca()?
Message-ID: <1990May19.044239.16031@egsner.cirr.com>
Date: 19 May 90 04:42:39 GMT
Organization: Central Iowa (Model) Railroad, Dallas, Tx.
Lines: 20
Posted: Sat May 19 05:42:39 1990