Skip to content

Reduce default thread stack size to 64KB #19043

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 31, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion system/lib/libc/musl/src/internal/pthread_impl.h
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,7 @@ extern hidden unsigned __default_guardsize;

#ifdef __EMSCRIPTEN__
// Keep in sync with DEFAULT_PTHREAD_STACK_SIZE in settings.js
#define DEFAULT_STACK_SIZE (2*1024*1024)
#define DEFAULT_STACK_SIZE (64*1024)
#else
#define DEFAULT_STACK_SIZE 131072
#endif
Expand Down
4 changes: 2 additions & 2 deletions test/other/test_default_pthread_stack_size.c
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ int main() {
size_t stacksize;
pthread_attr_getstacksize(&attr, &stacksize);
printf("%zu\n", stacksize);
// Should match DEFAULT_PTHREAD_STACK_SIZE = 2*1024*1024;
assert(stacksize == 2*1024*1024);
// Should match DEFAULT_PTHREAD_STACK_SIZE = 64*1024;
assert(stacksize == 64*1024);
return 0;
}