aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrooks Davis <brooks@FreeBSD.org>2024-07-25 23:10:44 +0000
committerBrooks Davis <brooks@FreeBSD.org>2024-07-25 23:11:11 +0000
commitf5c894479e5986323a0d5a5a698c7d2177eec20f (patch)
tree9ccd54d8d354ef0d50ee86e096b9b7d90be7ed4f
parent2b229739e7ca43b36e53f47147ac05a91333f7b9 (diff)
downloadsrc-f5c894479e5986323a0d5a5a698c7d2177eec20f.tar.gz
src-f5c894479e5986323a0d5a5a698c7d2177eec20f.zip
Revert "Avoid division in round_up."
This reverts commit 2b229739e7ca43b36e53f47147ac05a91333f7b9. Pull Request: https://github.com/freebsd/freebsd-src/pull/1343
-rw-r--r--lib/libthr/thread/thr_stack.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/libthr/thread/thr_stack.c b/lib/libthr/thread/thr_stack.c
index ab3b73085bb5..f576a2c04104 100644
--- a/lib/libthr/thread/thr_stack.c
+++ b/lib/libthr/thread/thr_stack.c
@@ -126,7 +126,10 @@ static char *last_stack = NULL;
static inline size_t
round_up(size_t size)
{
- return (roundup2(size, _thr_page_size - 1));
+ if (size % _thr_page_size != 0)
+ size = ((size / _thr_page_size) + 1) *
+ _thr_page_size;
+ return size;
}
void