Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!dali.cs.montana.edu!caen!sdd.hp.com!spool.mu.edu!uunet!lll-winken!sun-barr!newstop!exodus!rbbb.Eng.Sun.COM!chased From: chased@rbbb.Eng.Sun.COM (David Chase) Newsgroups: comp.std.c++ Subject: Re: Creeping feature #769: `new auto' Keywords: dynamic stack allocation, alloca Message-ID: <12759@exodus.Eng.Sun.COM> Date: 2 May 91 22:47:43 GMT References: <1991May2.074928.25507@kestrel.edu> Sender: news@exodus.Eng.Sun.COM Distribution: comp.std.c++ Organization: Sun Microsystems, Mt. View, Ca. Lines: 21 gyro@kestrel.edu (Scott Layson Burson) writes: >It struck me today that it would be awfully nice to have a high level, >type-safe interface to `alloca' (which allocates a block of memory of >specified size in the caller's stack frame). >A syntax is easily enough come by: `new auto '. >This probably won't fly, since `alloca' is not in the ANSI library and >may be difficult to write for some implementations ... In theory, there's no need for alloca. All the machinery needed to implement running-of-destructors-for-local-objects can be used to simulate alloca on top of malloc and free. It's not as efficient, but it isn't impossible. Compilers for systems w/o alloca will just need to work a little harder. Sigh. Another feature. Has anyone considered removing features from the language instead of adding them? David Chase Sun