Path: utzoo!utgpu!news-server.csri.toronto.edu!clyde.concordia.ca!uunet!tut.cis.ohio-state.edu!pt.cs.cmu.edu!zog.cs.cmu.edu!tgl From: tgl@zog.cs.cmu.edu (Tom Lane) Newsgroups: comp.sys.hp Subject: Re: alloca() on the HP9000/300 Message-ID: <10328@pt.cs.cmu.edu> Date: 26 Aug 90 21:49:40 GMT References: <1455@tub.UUCP> <5570477@hpfcdc.HP.COM> Organization: Carnegie-Mellon University, CS/RI Lines: 25 In article <5570477@hpfcdc.HP.COM>, rer@hpfcdc.HP.COM (Rob Robason) writes: > jrc> I'm surprised no one has mentioned the implementation of alloca() > jrc> distributed with GNU EMACS for the 9000. > > This is the same as the version shipped in libPW.a on HP-UX. It is in the > public domain and was written by D A Gwyn. This version has the problems > described previously of using malloc and a garbage collection scheme which > is invoked when it is called subsequently. Au contraire. Recent versions of GNU Emacs include both Gwyn's package and assembly-level hacks for some specific machines, one of which is the 300 series. The 300-specific code does a real alloca by decrementing SP. It is fairly specific to HP's cc because it knows about the compiler's register save/restore habits. I believe it stops working with the HPUX 7.0 cc if you turn optimization up past +O1; presumably this is because the compiler may start using SP-relative addressing instead of a frame pointer. But Emacs works just fine with this code and +O1 optimization; I use it daily. -- tom lane Internet: tgl@cs.cmu.edu UUCP: !cs.cmu.edu!tgl BITNET: tgl%cs.cmu.edu@cmuccvma CompuServe: >internet:tgl@cs.cmu.edu