DragonFly BSD
DragonFly submit List (threaded) for 2005-01
[Date Prev][Date Next]  [Thread Prev][Thread Next]  [Date Index][Thread Index]

Re: vmstat WARNS6 cleanup


From: Joerg Sonnenberger <joerg@xxxxxxxxxxxxxxxxx>
Date: Sat, 8 Jan 2005 21:29:24 +0100
Mail-followup-to: submit@crater.dragonflybsd.org

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



[Date Prev][Date Next]  [Thread Prev][Thread Next]  [Date Index][Thread Index]