diff --git a/common/profiler.cpp b/common/profiler.cpp index 2d841768..26e17f20 100644 --- a/common/profiler.cpp +++ b/common/profiler.cpp @@ -48,6 +48,20 @@ #include +static size_t get_page_size() { + size_t page_size = 0; + +#ifdef _WIN32 + SYSTEM_INFO si; + GetSystemInfo(&si); + page_size = si.dwPageSize; +#elif defined(__APPLE__) || defined(__linux__) + page_size = sysconf(_SC_PAGESIZE); +#endif + + return page_size; +} + static const char * get_uname_os() { std::unique_ptr pipe(popen("uname -o", "r"), pclose); if (!pipe) { @@ -728,20 +742,6 @@ uint64_t device_swap_memory(bool available) { } } -static size_t get_page_size() { - size_t page_size = 0; - -#ifdef _WIN32 - SYSTEM_INFO si; - GetSystemInfo(&si); - page_size = si.dwPageSize; -#elif defined(__APPLE__) || defined(__linux__) - page_size = sysconf(_SC_PAGESIZE); -#endif - - return page_size; -} - static std::string get_default_device_path() { #ifdef __linux__ // find the first block device under /sys/block