mirror of
https://github.com/xmrig/xmrig.git
synced 2024-12-23 12:09:22 +00:00
Fixed "huge-pages" option.
This commit is contained in:
parent
487b2a3655
commit
52281906c6
5 changed files with 11 additions and 9 deletions
|
@ -23,8 +23,8 @@
|
|||
*/
|
||||
|
||||
|
||||
#include <inttypes.h>
|
||||
#include <stdio.h>
|
||||
#include <cinttypes>
|
||||
#include <cstdio>
|
||||
#include <uv.h>
|
||||
|
||||
|
||||
|
@ -59,10 +59,10 @@ inline static const char *asmName(Assembly::Id assembly)
|
|||
#endif
|
||||
|
||||
|
||||
static void print_memory(Config *) {
|
||||
static void print_memory(Config *config) {
|
||||
# ifdef _WIN32
|
||||
Log::print(GREEN_BOLD(" * ") WHITE_BOLD("%-13s") "%s",
|
||||
"HUGE PAGES", VirtualMemory::isHugepagesAvailable() ? GREEN_BOLD("permission granted") : RED_BOLD("unavailable"));
|
||||
"HUGE PAGES", config->cpu().isHugePages() ? (VirtualMemory::isHugepagesAvailable() ? GREEN_BOLD("permission granted") : RED_BOLD("unavailable")) : RED_BOLD("disabled"));
|
||||
# endif
|
||||
}
|
||||
|
||||
|
|
|
@ -112,7 +112,7 @@ void xmrig::VirtualMemory::destroy()
|
|||
void xmrig::VirtualMemory::init(size_t poolSize, bool hugePages)
|
||||
{
|
||||
if (!pool) {
|
||||
osInit();
|
||||
osInit(hugePages);
|
||||
}
|
||||
|
||||
# ifdef XMRIG_FEATURE_HWLOC
|
||||
|
|
|
@ -78,7 +78,7 @@ private:
|
|||
FLAG_MAX
|
||||
};
|
||||
|
||||
static void osInit();
|
||||
static void osInit(bool hugePages);
|
||||
|
||||
bool allocateLargePagesMemory();
|
||||
void freeLargePagesMemory();
|
||||
|
|
|
@ -96,7 +96,7 @@ void xmrig::VirtualMemory::unprotectExecutableMemory(void *p, size_t size)
|
|||
}
|
||||
|
||||
|
||||
void xmrig::VirtualMemory::osInit()
|
||||
void xmrig::VirtualMemory::osInit(bool)
|
||||
{
|
||||
}
|
||||
|
||||
|
|
|
@ -201,10 +201,12 @@ void xmrig::VirtualMemory::unprotectExecutableMemory(void *p, size_t size)
|
|||
}
|
||||
|
||||
|
||||
void xmrig::VirtualMemory::osInit()
|
||||
void xmrig::VirtualMemory::osInit(bool hugePages)
|
||||
{
|
||||
if (hugePages) {
|
||||
hugepagesAvailable = TrySetLockPagesPrivilege();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
bool xmrig::VirtualMemory::allocateLargePagesMemory()
|
||||
|
|
Loading…
Reference in a new issue