Path: utzoo!attcan!uunet!mcvax!ukc!warwick!cudcv From: cudcv@warwick.ac.uk (Rob McMahon) Newsgroups: comp.lang.c Subject: Re: Alloca, FSF software assumptions (was: Re: Are yacc parsers portable ?) Keywords: yacc, bison, parsers Message-ID: <28@titania.warwick.ac.uk> Date: 7 Aug 88 21:40:59 GMT References: <3950010@eecs.nwu.edu> <62170@sun.uucp> <10501@stb.UUCP> Reply-To: cudcv@warwick.ac.uk (Rob McMahon) Organization: Computing Services, Warwick University, UK Lines: 30 In article <10501@stb.UUCP> michael@stb.UUCP (Michael) writes: >Actually, alloca() isn't that big of a problem. Annoyance, yes, but you >can get a PD version of alloca that is nearly identical and 98%+ portable, >and I've seen completely compatible subroutines for ibm's, 68K's, pdp's, etc. If this is the same alloca() that Gould supply with their Unix, UTX-32, it has big problems with the GNU software. When you call this version, it frees any memory that was allocated from further up the stack. Quite often, though, it is called repeatedly at the same level, and the memory is never freed, as in: for (long loop) { ... func (); } func () { alloca (much memory); ... } Compiling the gcc parser using this alloca, the compiler ran out of swap space space and died. (We had ~40M swap space, and there was one other large (10M) job running and not much else.) Rob -- UUCP: ...!mcvax!ukc!warwick!cudcv PHONE: +44 203 523037 JANET: cudcv@uk.ac.warwick ARPA: cudcv@warwick.ac.uk Rob McMahon, Computing Services, Warwick University, Coventry CV4 7AL, England