alloca

Jeff Dickson jdickson at spanza.jpl.nasa.gov
Thu May 4 19:16:36 AEST 1989


	I agree with Root Boy. I use alloca() exclusively on Sun O.S. 4.0 to
set aside a large chunk of space in which to do my own memory allocation
-deallocation out of. I first tried to use malloc/free, but had chronic prob-
lems with it. It wasn't so much that those calls failed, it was that they
failed and/or caused other unexplainable problems when they were called many
times a second. My code doesn't use much memory, but it does do many allocations
and deallocations per second. I have found however, that I can do essentially
the same thing as alloca() by declaring a large automatic array of character. 
In that respect, it isn't totally necessary that I use alloca().
	I really don't understand what the big fuss over alloca() is. So what
that it does some weird things to the code. At least IT works. But then again,
my code may not use it in the insane sense that others are refering to. My 
code does not call it often. In fact, I largely call it in the beginning of
the process.

				jdickson at zook.jpl.nasa.gov



More information about the Comp.unix.wizards mailing list