Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Avoid division in round_up #1343

Closed
wants to merge 2 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 1 addition & 4 deletions lib/libthr/thread/thr_stack.c
Original file line number Diff line number Diff line change
Expand Up @@ -126,13 +126,10 @@
static inline size_t
round_up(size_t size)
{
if (size % _thr_page_size != 0)
size = ((size / _thr_page_size) + 1) *
_thr_page_size;
return size;
return (roundup2(size, _thr_page_size));
}

void

Check warning on line 132 in lib/libthr/thread/thr_stack.c

View workflow job for this annotation

GitHub Actions / Style Checker

Missing Signed-off-by: line

Check warning on line 132 in lib/libthr/thread/thr_stack.c

View workflow job for this annotation

GitHub Actions / Style Checker

Missing Signed-off-by: line
_thr_stack_fix_protection(struct pthread *thrd)
{

Expand Down
Loading