Path: utzoo!attcan!uunet!lll-winken!lll-lcc!ames!umd5!mimsy!chris From: chris@mimsy.UUCP (Chris Torek) Newsgroups: comp.unix.wizards Subject: alloca Message-ID: <11920@mimsy.UUCP> Date: 11 Jun 88 10:01:41 GMT References: <16018@brl-adm.ARPA> <500@philmds.UUCP> Organization: U of Maryland, Dept. of Computer Science, Coll. Pk., MD 20742 Lines: 25 Put it this way: If you have a stack or an emulation of a stack (as required by recursive functions), and if `alloca' is a compiler builtin, the concept can be implemented. Hence alloca can be *made* portable to any C compiler, if only by fiat (declare that henceforth `alloca' is a keyword or is otherwise reserved). Now the problem becomes one of convincing compiler writers that alloca (possibly by some other name) is worth adding as a reserved word, or (on some systems) simply writing it in assembly (either as a routine or with `inline assembly'). Note that alloca is not a panacea, and that it can largely be simulated with dynamically sized arrays, as in int n = get_n(); { char like_alloca[n]; ... } These are not identical concepts, but they are interrelated. Whether one is `more important' or `more useful' than another I will not venture to say. -- In-Real-Life: Chris Torek, Univ of MD Comp Sci Dept (+1 301 454 7163) Domain: chris@mimsy.umd.edu Path: uunet!mimsy!chris