Path: utzoo!utgpu!news-server.csri.toronto.edu!rutgers!cs.utexas.edu!samsung!uunet!metaware!fjb From: fjb@metaware.metaware.com (Fred Bourgeois) Newsgroups: comp.lang.c Subject: Re: scope of malloc Summary: Wrong Keywords: alloca Message-ID: <650@metaware.metaware.com> Date: 14 Nov 90 02:47:29 GMT References: <3729@skye.ed.ac.uk> <14413@smoke.brl.mil> <3739@skye.ed.ac.uk> <14448@smoke.brl.mil> Reply-To: fjb@metaware.UUCP (Fred Bourgeois) Distribution: usa Organization: MetaWare Lines: 22 In article <14448@smoke.brl.mil> gwyn@smoke.brl.mil (Doug Gwyn) writes: >In article <3739@skye.ed.ac.uk> richard@aiai.UUCP (Richard Tobin) writes: >>Are there *any* widely-used processors that can't implement alloca() >>reasonably efficiently even with compiler support? > >It can't be implemented correctly (except by the compiler turning it into >malloc()/free() calls that you could have coded yourself) on any system >that doesn't provide separate frame and stack pointers. Just consider >the effects of an interrupt. It also cannot be reasonably implemented on >a system that uses linked stack frames, such as on the IBM System/370. You are Wrong. Our compiler implements alloca() as an intrinsic, and does it correctly. ... even on the 370 ... ------------------------------------------------------------------------------ Fred Bourgeois, MetaWare Inc., 2161 Delaware Avenue, Santa Cruz, CA 95060-2806 fjb@metaware.com ...!uunet!metaware!fjb Colorless Green Ideas Sleep Furiously, and so do I. ------------------------------------------------------------------------------