diff --git a/src/Summary.cpp b/src/Summary.cpp index d27c6fa0..ebaeb356 100644 --- a/src/Summary.cpp +++ b/src/Summary.cpp @@ -47,6 +47,13 @@ namespace xmrig { +#ifdef XMRIG_OS_WIN +static constexpr const char *kHugepagesSupported = GREEN_BOLD("permission granted"); +#else +static constexpr const char *kHugepagesSupported = GREEN_BOLD("supported"); +#endif + + #ifdef XMRIG_FEATURE_ASM static const char *coloredAsmNames[] = { RED_BOLD("none"), @@ -66,17 +73,13 @@ inline static const char *asmName(Assembly::Id assembly) static void print_memory(Config *config) { -# ifdef XMRIG_OS_WIN Log::print(GREEN_BOLD(" * ") WHITE_BOLD("%-13s") "%s", - "HUGE PAGES", config->cpu().isHugePages() ? (VirtualMemory::isHugepagesAvailable() ? GREEN_BOLD("permission granted") : RED_BOLD("unavailable")) : RED_BOLD("disabled")); -# else - Log::print(GREEN_BOLD(" * ") WHITE_BOLD("%-13s") "%s", "HUGE PAGES", config->cpu().isHugePages() ? GREEN_BOLD("supported") : RED_BOLD("disabled")); -# endif + "HUGE PAGES", config->cpu().isHugePages() ? (VirtualMemory::isHugepagesAvailable() ? kHugepagesSupported : RED_BOLD("unavailable")) : RED_BOLD("disabled")); # ifdef XMRIG_ALGO_RANDOMX # ifdef XMRIG_OS_LINUX Log::print(GREEN_BOLD(" * ") WHITE_BOLD("%-13s") "%s", - "1GB PAGES", (VirtualMemory::isOneGbPagesAvailable() ? (config->rx().isOneGbPages() ? GREEN_BOLD("supported") : YELLOW_BOLD("disabled")) : YELLOW_BOLD("unavailable"))); + "1GB PAGES", (VirtualMemory::isOneGbPagesAvailable() ? (config->rx().isOneGbPages() ? kHugepagesSupported : YELLOW_BOLD("disabled")) : YELLOW_BOLD("unavailable"))); # else Log::print(GREEN_BOLD(" * ") WHITE_BOLD("%-13s") "%s", "1GB PAGES", YELLOW_BOLD("unavailable")); # endif diff --git a/src/crypto/common/VirtualMemory_unix.cpp b/src/crypto/common/VirtualMemory_unix.cpp index 2b32b89d..60d77cca 100644 --- a/src/crypto/common/VirtualMemory_unix.cpp +++ b/src/crypto/common/VirtualMemory_unix.cpp @@ -59,7 +59,11 @@ bool xmrig::VirtualMemory::isHugepagesAvailable() { +# if defined(XMRIG_OS_MACOS) && defined(XMRIG_ARM) + return false; +# else return true; +# endif }