delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/1996/12/29/08:36:48

From: root AT jacob DOT remcomp DOT fr (root)
Subject: Stack probes in gcc
29 Dec 1996 08:36:48 -0800 :
Sender: daemon AT cygnus DOT com
Approved: cygnus DOT gnu-win32 AT cygnus DOT com
Distribution: cygnus
Message-ID: <m0veMdR-000APlC.cygnus.gnu-win32@jacob.remcomp.fr>
Original-To: gnu-win32 AT cygnus DOT com
Original-Sender: owner-gnu-win32 AT cygnus DOT com

I would like to know if this program traps with gcc:
main()
{
	int table[15000];
	table[14999] = 67;
}
The reason is that I have discovered the following:
Default stack commit size is only 4K. To avoid traps, MSVC generates code
to call a function that will touch all stack pages needed by the function
in the function's prolog. I THINK that this is done only if the stack
frame is larger than 4K. I would like to know how gcc solves this problem
so that I can do a similar thing.

Of course all this can be avoided if you set the stack-commit size at
link-time with a command-line argument to the linker, but I think my users 
would prefer an automatic solution. What does gcc do?

Thanks in advance and sorry for this kind of trivia...

-- 
Jacob Navia	Logiciels/Informatique
41 rue Maurice Ravel			Tel 01 48.23.51.44
93430 Villetaneuse 			Fax 01 48.23.95.39
France
-
For help on using this list, send a message to
"gnu-win32-request AT cygnus DOT com" with one line of text: "help".

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019