Merge pull request #19701 from yunjiaw26/MovePageSize

Change page_size to local variable
pull/19059/head^2
yunjiaw26 6 years ago committed by GitHub
commit 809e7c9513
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 7
      src/core/lib/gprpp/thd_posix.cc

@ -49,11 +49,10 @@ struct thd_arg {
bool tracked;
};
// TODO(yunjiaw): move this to a function-level static, or remove the use of a
// non-constexpr initializer when possible
const size_t page_size = static_cast<size_t>(sysconf(_SC_PAGESIZE));
size_t RoundUpToPageSize(size_t size) {
// TODO(yunjiaw): Change this variable (page_size) to a function-level static
// when possible
size_t page_size = static_cast<size_t>(sysconf(_SC_PAGESIZE));
return (size + page_size - 1) & ~(page_size - 1);
}

Loading…
Cancel
Save