summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorcharlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4>2004-10-27 12:28:25 +0000
committercharlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4>2004-10-27 12:28:25 +0000
commit2ade6f499615f562768c0d08bac68e2fedb9413a (patch)
tree0db4c40cdc047ab66734576e2532ca51e81ab5ec
parent4152af2fd1b39a2806dc036c3b68bc9a5b54511f (diff)
downloadgcc-2ade6f499615f562768c0d08bac68e2fedb9413a.tar.gz
2004-10-26 Pascal Obry <obry@gnat.com>
* s-parame-mingw.adb (Default_Stack_Size): Add some comments. * s-taprop-mingw.adb (Create_Task): Set initial stack size to 1024. On Windows only the initial thread stack size can be set so it is good to start we a low stack size. The OS will adjust the size as needed. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@89641 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r--gcc/ada/s-parame-mingw.adb6
-rw-r--r--gcc/ada/s-taprop-mingw.adb9
2 files changed, 14 insertions, 1 deletions
diff --git a/gcc/ada/s-parame-mingw.adb b/gcc/ada/s-parame-mingw.adb
index d77ebdbcca1..88d660fb0f0 100644
--- a/gcc/ada/s-parame-mingw.adb
+++ b/gcc/ada/s-parame-mingw.adb
@@ -56,6 +56,12 @@ package body System.Parameters is
-- Default_Stack_Size --
------------------------
+ -- Note that on Windows this is not really the default stack size. It
+ -- is the default used for the stack checking support but there is no
+ -- way to set the thread stack size at runtime. Only the initial thread
+ -- stack size can be specified. The real stack size limit is set at
+ -- link time. See GNU/Linker --stack=x,y option.
+
function Default_Stack_Size return Size_Type is
begin
return 20 * 1024;
diff --git a/gcc/ada/s-taprop-mingw.adb b/gcc/ada/s-taprop-mingw.adb
index 5656661f8ca..e85d90320b7 100644
--- a/gcc/ada/s-taprop-mingw.adb
+++ b/gcc/ada/s-taprop-mingw.adb
@@ -843,6 +843,13 @@ package body System.Task_Primitives.Operations is
Priority : System.Any_Priority;
Succeeded : out Boolean)
is
+ pragma Unreferenced (Stack_Size);
+
+ Initial_Stack_Size : constant := 1024;
+ -- We set the initial stack size to 1024. On Windows there is no way to
+ -- fix a task stack size. Only the initial stack size can be set, the
+ -- operating system will raise the task stack size if needed.
+
hTask : HANDLE;
TaskId : aliased DWORD;
pTaskParameter : System.OS_Interface.PVOID;
@@ -856,7 +863,7 @@ package body System.Task_Primitives.Operations is
hTask := CreateThread
(null,
- DWORD (Adjust_Storage_Size (Stack_Size)),
+ Initial_Stack_Size,
Entry_Point,
pTaskParameter,
DWORD (Create_Suspended),