GNU diff for XENIX [was Re: LaTeX for Xenix ...]

Chip Rosenthal chip at chinacat.Lonestar.ORG
Fri Mar 2 11:35:12 AEST 1990


In article <190 at rdb1.UUCP> root at 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 at chinacat.Lonestar.ORG                |  a lucky man, but are you a smart
Unicom Systems Development, 512-482-8260  |  man?  -David Bromberg



More information about the Comp.unix.xenix mailing list