From 127d7f4b00ebf4afec7d8a2aeaba7ed3d4329d67 Mon Sep 17 00:00:00 2001 From: cxl Date: Thu, 3 Nov 2016 09:05:50 +0000 Subject: [PATCH] Core: Win32 Thread now reserves smaller stack, AuxThread even smaller than than (1MB, 512KB) git-svn-id: svn://ultimatepp.org/upp/trunk@10391 f0d560ea-af0d-0410-9eb7-867de7ffcac7 --- uppsrc/Core/Mt.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/uppsrc/Core/Mt.cpp b/uppsrc/Core/Mt.cpp index 524b4c49c..6bbcabced 100644 --- a/uppsrc/Core/Mt.cpp +++ b/uppsrc/Core/Mt.cpp @@ -146,7 +146,7 @@ bool Thread::Run(Function _cb, bool noshutdown) p->noshutdown = noshutdown; #ifdef PLATFORM_WIN32 #ifdef CPU_32 // in 32-bit, reduce stack size to 1MB to fit more threads into address space - handle = (HANDLE)_beginthreadex(0, 1024*1024, sThreadRoutine, p, 0, ((unsigned int *)(&thread_id))); + handle = (HANDLE)_beginthreadex(0, 1024*1024, sThreadRoutine, p, STACK_SIZE_PARAM_IS_A_RESERVATION, ((unsigned int *)(&thread_id))); #else handle = (HANDLE)_beginthreadex(0, 0, sThreadRoutine, p, 0, ((unsigned int *)(&thread_id))); #endif @@ -633,7 +633,7 @@ bool StartAuxThread(auxthread_t (auxthread__ *fn)(void *ptr), void *ptr) { #ifdef PLATFORM_WIN32 HANDLE handle; - handle = CreateThread(NULL, 0, fn, ptr, 0, NULL); + handle = CreateThread(NULL, 512*1024, fn, ptr, STACK_SIZE_PARAM_IS_A_RESERVATION, NULL); if(handle) { CloseHandle(handle); return true;