Skip to content

Commit aae5c40

Browse files
authored
Fix error in caml_get_init_stack_wsize (#3481)
1 parent 525868c commit aae5c40

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

runtime/fiber.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,8 @@ uintnat caml_get_init_stack_wsize (int thread_stack_wsz)
8585
page size. However, the stack guard pages, headers, etc. have
8686
some overhead, so we want the requested stack size to be a bit
8787
less than a multiple of the hugepage size */
88-
if (stack_wsize > Wsize_bsize(caml_plat_hugepagesize)) {
88+
if (caml_plat_hugepagesize > 0
89+
&& stack_wsize > Wsize_bsize(caml_plat_hugepagesize)) {
8990
/* round down to multiple of hugepage size */
9091
stack_wsize &= ~(Wsize_bsize(caml_plat_hugepagesize) - 1);
9192
/* 3 pages is enough to cover the overhead */

0 commit comments

Comments
 (0)