This is the mail archive of the
mailing list for the Cygwin project.
RE:size limit for static arrays in cygwin/gcc
- From: Randall R Schulz <rrschulz at cris dot com>
- To: cygwin at cygwin dot com
- Date: Mon, 17 Feb 2003 17:04:52 -0800
- Subject: RE:size limit for static arrays in cygwin/gcc
At 12:55 2003-02-17, Danny Smith wrote:
I was clearly confused about what "alloca" does: It allocates space on
the stack, _not_ on the heap, as I thought.
Randall R Schulz <rrschulz at cris dot com> wrote:
> A couple of months ago, someone reported on how local (stack)
> allocations larger than a certain threshold were allocated on the heap.
> In fact, you, Danny, contributed materially to that thread: Subject
> "Strange behaviour of gcc" starting with a posting by
> email@example.com on Dec. 24, 2002.
No that's not quite right:
Stack allocations larger than one page (4KB) cause gcc to probe the stack.
The allocation is still static
However, there must be a terminological issue here, because I would
describe what alloca does as _dynamic_ stack-resident allocation. It is
dynamic because it happens as a result of a run-time call. I understand
static to mean an action (allocation, binding, computation, etc.) that
is handled entirely at compile and / or link time.
I think, also, the stack probe is automatically called in main, to force
alignment of stack to a page boundary.
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
Bug reporting: http://cygwin.com/bugs.html