Просмотр исходного кода

Reduce stack usage for threads

Reduce stack usage, because large logging buffers are removed from
stack.
z3APA3A 10 лет назад
Родитель
Сommit
9876172e0b
1 измененных файлов с 2 добавлено и 2 удалено
  1. 2 2
      src/proxymain.c

+ 2 - 2
src/proxymain.c

@@ -173,7 +173,7 @@ int MODULEMAINFUNC (int argc, char** argv){
  signal(SIGPIPE, SIG_IGN);
  signal(SIGPIPE, SIG_IGN);
 
 
  pthread_attr_init(&pa);
  pthread_attr_init(&pa);
- pthread_attr_setstacksize(&pa,PTHREAD_STACK_MIN + 16384);
+ pthread_attr_setstacksize(&pa,PTHREAD_STACK_MIN + 8192);
  pthread_attr_setdetachstate(&pa,PTHREAD_CREATE_DETACHED);
  pthread_attr_setdetachstate(&pa,PTHREAD_CREATE_DETACHED);
 #endif
 #endif
 #endif
 #endif
@@ -601,7 +601,7 @@ int MODULEMAINFUNC (int argc, char** argv){
 #ifndef _WINCE
 #ifndef _WINCE
 	h = (HANDLE)_beginthreadex((LPSECURITY_ATTRIBUTES )NULL, (unsigned)16384, threadfunc, (void *) newparam, 0, &thread);
 	h = (HANDLE)_beginthreadex((LPSECURITY_ATTRIBUTES )NULL, (unsigned)16384, threadfunc, (void *) newparam, 0, &thread);
 #else
 #else
-	h = (HANDLE)CreateThread((LPSECURITY_ATTRIBUTES )NULL, (unsigned)32768, threadfunc, (void *) newparam, 0, &thread);
+	h = (HANDLE)CreateThread((LPSECURITY_ATTRIBUTES )NULL, (unsigned)16384, threadfunc, (void *) newparam, 0, &thread);
 #endif
 #endif
 	srv.childcount++;
 	srv.childcount++;
 	if (h) {
 	if (h) {