Path: utzoo!utgpu!water!watmath!clyde!att!alberta!ubc-cs!uw-beaver!cornell!batcomputer!itsgw!steinmetz!uunet!sdrc!scjones From: scjones@sdrc.UUCP (Larry Jones) Newsgroups: comp.lang.c Subject: Re: alloca(), #if, and other controversial things... Message-ID: <355@sdrc.UUCP> Date: 21 Aug 88 17:01:24 GMT References: <8808171410.AA05337@ucbvax.Berkeley.EDU> <1259@garth.UUCP> <1270@garth.UUCP> Organization: Structural Dynamics Research Corp., Cincinnati Lines: 16 Just to confuse the discussion further, what about machines / operating systems which do not have a stack? It is perfectly reasonable to support recursion by explicitly allocating heap memory to hold local variables on entry to the function and freeing it on exit. To support alloca in this type of system requires reallocating the block (which may mean allocating a new, bigger block and copying the old block into it, except that would screw up pointers...) or maintaining a linked list of blocks. Seems like an awful lot of overhead to avoid writing a couple of calls to free(). ---- Larry Jones UUCP: uunet!sdrc!scjones SDRC scjones@sdrc 2000 Eastman Dr. BIX: ltl Milford, OH 45150 AT&T: (513) 576-2070 Nancy Reagan on superconductivity: "Just say mho."