Skip to content

Commit 5d5b14b

Browse files
authored
Reduce default thread stack size to 64KB (#19043)
1 parent 5d3e69f commit 5d5b14b

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

system/lib/libc/musl/src/internal/pthread_impl.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -251,7 +251,7 @@ extern hidden unsigned __default_guardsize;
251251

252252
#ifdef __EMSCRIPTEN__
253253
// Keep in sync with DEFAULT_PTHREAD_STACK_SIZE in settings.js
254-
#define DEFAULT_STACK_SIZE (2*1024*1024)
254+
#define DEFAULT_STACK_SIZE (64*1024)
255255
#else
256256
#define DEFAULT_STACK_SIZE 131072
257257
#endif

test/other/test_default_pthread_stack_size.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ int main() {
88
size_t stacksize;
99
pthread_attr_getstacksize(&attr, &stacksize);
1010
printf("%zu\n", stacksize);
11-
// Should match DEFAULT_PTHREAD_STACK_SIZE = 2*1024*1024;
12-
assert(stacksize == 2*1024*1024);
11+
// Should match DEFAULT_PTHREAD_STACK_SIZE = 64*1024;
12+
assert(stacksize == 64*1024);
1313
return 0;
1414
}

0 commit comments

Comments
 (0)