From a06f6ec396abe23cdccf5ed96ebdf2897c4ee3e3 Mon Sep 17 00:00:00 2001 From: Mitya Selivanov <0x7fffff@guattari.ru> Date: Thu, 18 Aug 2022 19:11:18 +0400 Subject: test --- source/kit/threads.posix.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'source') diff --git a/source/kit/threads.posix.c b/source/kit/threads.posix.c index c42c67e..2dea666 100644 --- a/source/kit/threads.posix.c +++ b/source/kit/threads.posix.c @@ -244,10 +244,9 @@ int thrd_create_with_stack(thrd_t *thr, thrd_start_t func, void *arg, if (require_stack_size > 0) { ptrdiff_t const page_size = (ptrdiff_t) sysconf(_SC_PAGESIZE); ptrdiff_t const delta = require_stack_size % page_size; - ptrdiff_t const stack_size = delta == 0 - ? require_stack_size - : require_stack_size + - require_stack_size - delta; + ptrdiff_t const stack_size = delta == 0 ? require_stack_size + : require_stack_size + + page_size - delta; if (pthread_attr_init(&attr) != 0) return thrd_nomem; if (pthread_attr_setstacksize(&attr, (size_t) stack_size) != 0) { -- cgit v1.2.3