vmstat WARNS6 cleanup

Joerg Sonnenberger joerg at britannica.bec.de
Sat Jan 8 12:30:21 PST 2005


On Sat, Jan 08, 2005 at 08:48:34PM +0100, Peter Schuller wrote:
> Yes, I am aware of this. Hence any use of alloca is going to be an optimiation
> only, conditional on the buffer size being below some small value -> malloc
> would be required anyway so it doesn't solve the exit path issue.

In almost all cases, malloc is better than alloca, if only to warrant some
extra care to free the memory and therefore keep track of what you
allocated. Yes, this is exactly the reverse of Garbage Collection, but
GC is not always The Right Thing (TM).

Therefore patches to change alloca uses correctly into malloc / free uses
or other great stack allocations are certainly welcome. Keep in mind though,
that we don't bother about one or two pages of stack in a leaf function,
but anything above let's say 32 pages [add other arbitrary value here]
should be really investigated.

Joerg





More information about the Submit mailing list