[Top][All Lists]

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

[Bug-gnulib] Re: alloca

From: Bruno Haible
Subject: [Bug-gnulib] Re: alloca
Date: Thu, 13 Nov 2003 13:38:46 +0100
User-agent: KMail/1.5

James Youngman wrote:
> In the specific case of Linux, you should be able to get around the
> problem by ensuring that you fill your arrays backwards.  Linux will
> extend the stack as long as the page you haven't touched isn't "too
> far" below the current stack.  This means touching the high-address
> end of arrays first.  You don't even need to touch every address -
> every N megabytes is often enough (from memory, N=7 is OK, N=8 might
> be OK).

This is a myth. Something like this was true for OS/2 (where the compiler
inserted instructions to touch the stack at least every 4096 bytes). But
in Linux, all you are saying here is wrong. Look at the function
expand_stack() in include/linux/mm.h.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]