From ce686031ba2d298b9c20451cfff035205bc4e6db Mon Sep 17 00:00:00 2001 From: Alexandre Julliard Date: Wed, 3 May 2000 17:45:14 +0000 Subject: [PATCH] Fixed default thread stack size. --- scheduler/thread.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/scheduler/thread.c b/scheduler/thread.c index 9499d750dc7..f9d710572b3 100644 --- a/scheduler/thread.c +++ b/scheduler/thread.c @@ -132,6 +132,16 @@ TEB *THREAD_InitStack( TEB *teb, DWORD stack_size, BOOL alloc_stack16 ) if (stack_size >= 16*1024*1024) WARN("Thread stack size is %ld MB.\n",stack_size/1024/1024); + /* if size is smaller than default, get stack size from parent */ + if (stack_size < 1024 * 1024) + { + if (teb) + stack_size = 1024 * 1024; /* no parent */ + else + stack_size = ((char *)NtCurrentTeb()->stack_top - (char *)NtCurrentTeb()->stack_base + - SIGNAL_STACK_SIZE - 3 * page_size); + } + /* FIXME: some Wine functions use a lot of stack, so we add 64Kb here */ stack_size += 64 * 1024;