diff options
-rw-r--r-- | thread_pthread_mn.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/thread_pthread_mn.c b/thread_pthread_mn.c index 8dadb269de..aa69515f32 100644 --- a/thread_pthread_mn.c +++ b/thread_pthread_mn.c @@ -174,8 +174,8 @@ nt_therad_stack_size(void) rb_vm_t *vm = GET_VM(); int sz = (int)(vm->default_params.thread_vm_stack_size + vm->default_params.thread_machine_stack_size + MSTACK_PAGE_SIZE); - int page_num = (sz + MSTACK_PAGE_SIZE - 1) / MSTACK_PAGE_SIZE; - msz = page_num * MSTACK_PAGE_SIZE; + int page_num = roomof(sz, MSTACK_PAGE_SIZE); + msz = (size_t)page_num * MSTACK_PAGE_SIZE; return msz; } |