Skip to content

Commit b67d6b2

Browse files
authored
setup_default_stack_size: set __default_stacksize unconditionally (WebAssembly#396)
If a user specifies a small stack size for the main, maybe it's reasonable to use the same size for threads as well.
1 parent 8daaba3 commit b67d6b2

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

libc-top-half/musl/src/env/__init_tls.c

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -47,10 +47,9 @@ static inline void setup_default_stack_size()
4747
stack_size = sp > &__global_base ? &__heap_base - &__data_end : (ptrdiff_t)&__global_base;
4848
}
4949

50-
if (stack_size > __default_stacksize)
51-
__default_stacksize =
52-
stack_size < DEFAULT_STACK_MAX ?
53-
stack_size : DEFAULT_STACK_MAX;
50+
__default_stacksize =
51+
stack_size < DEFAULT_STACK_MAX ?
52+
stack_size : DEFAULT_STACK_MAX;
5453
}
5554

5655
void __wasi_init_tp() {

0 commit comments

Comments
 (0)