mirror of
https://github.com/xmrig/xmrig.git
synced 2024-12-23 20:19:23 +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 <cinttypes>
|
||||||
#include <stdio.h>
|
#include <cstdio>
|
||||||
#include <uv.h>
|
#include <uv.h>
|
||||||
|
|
||||||
|
|
||||||
|
@ -59,10 +59,10 @@ inline static const char *asmName(Assembly::Id assembly)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
static void print_memory(Config *) {
|
static void print_memory(Config *config) {
|
||||||
# ifdef _WIN32
|
# ifdef _WIN32
|
||||||
Log::print(GREEN_BOLD(" * ") WHITE_BOLD("%-13s") "%s",
|
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
|
# endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -112,7 +112,7 @@ void xmrig::VirtualMemory::destroy()
|
||||||
void xmrig::VirtualMemory::init(size_t poolSize, bool hugePages)
|
void xmrig::VirtualMemory::init(size_t poolSize, bool hugePages)
|
||||||
{
|
{
|
||||||
if (!pool) {
|
if (!pool) {
|
||||||
osInit();
|
osInit(hugePages);
|
||||||
}
|
}
|
||||||
|
|
||||||
# ifdef XMRIG_FEATURE_HWLOC
|
# ifdef XMRIG_FEATURE_HWLOC
|
||||||
|
|
|
@ -78,7 +78,7 @@ private:
|
||||||
FLAG_MAX
|
FLAG_MAX
|
||||||
};
|
};
|
||||||
|
|
||||||
static void osInit();
|
static void osInit(bool hugePages);
|
||||||
|
|
||||||
bool allocateLargePagesMemory();
|
bool allocateLargePagesMemory();
|
||||||
void freeLargePagesMemory();
|
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();
|
hugepagesAvailable = TrySetLockPagesPrivilege();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
bool xmrig::VirtualMemory::allocateLargePagesMemory()
|
bool xmrig::VirtualMemory::allocateLargePagesMemory()
|
||||||
|
|
Loading…
Reference in a new issue