From 8d10d576d08efd1f7b997fc58c48f8e7721e2197 Mon Sep 17 00:00:00 2001 From: Yunjia Wang Date: Fri, 19 Jul 2019 10:55:16 -0700 Subject: [PATCH] Change page_size to local variable --- src/core/lib/gprpp/thd_posix.cc | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/core/lib/gprpp/thd_posix.cc b/src/core/lib/gprpp/thd_posix.cc index 99197cbbfa9..2c3ae34ed44 100644 --- a/src/core/lib/gprpp/thd_posix.cc +++ b/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(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(sysconf(_SC_PAGESIZE)); return (size + page_size - 1) & ~(page_size - 1); }