Path: utzoo!utgpu!jarvis.csri.toronto.edu!cs.utexas.edu!chinacat!chip From: chip@chinacat.Lonestar.ORG (Chip Rosenthal) Newsgroups: comp.unix.xenix Subject: Re: GNU diff for XENIX [was Re: LaTeX for Xenix ...] Message-ID: <955@chinacat.Lonestar.ORG> Date: 2 Mar 90 00:35:12 GMT References: <1990Feb15.233047.1867@metro.ucc.su.oz.au> <10306@hoptoad.uucp> <952@chinacat.Lonestar.ORG> <190@rdb1.UUCP> Organization: Unicom Systems Development, Austin (yay!) Lines: 21 In article <190@rdb1.UUCP> root@rdb1.UUCP (Robert Barrell) writes: >[Re: GNU diff on a 286] >Odd, though, diff compiled and linked without the -lPW, so I checked my libs >and found alloca() in ?libc.a. So, there already is an alloca() available. >Even so, it must not work too well, since I can only compare files of 4K >or less. alloca() is a lazy man's malloc(). The idea is that it gives you a bunch of memory which is automagically freed when the procedure returns. It does this by snarfing the memory off the stack so that the procedure return will cause the memory to be returned. Given that the default stack size is 0x1000 bytes, and gnu programs tend to alloca() like crazy, it isn't surprising that you can't get very far. I haven't looked at the source close enough to see how much gnu diff beats on alloca(), but you might want to fixhdr(C) the executable to make the stack bigger. -- Chip Rosenthal | Yes, you're a happy man and you're chip@chinacat.Lonestar.ORG | a lucky man, but are you a smart Unicom Systems Development, 512-482-8260 | man? -David Bromberg