1
0
mirror of https://github.com/xmrig/xmrig.git synced 2025-12-16 03:12:45 -05:00

Linux: added support for transparent huge pages

This commit is contained in:
SChernykh
2025-12-11 11:23:18 +01:00
parent 856813c1ae
commit 482a1f0b40
8 changed files with 32 additions and 5 deletions

View File

@@ -276,6 +276,16 @@ bool xmrig::VirtualMemory::allocateOneGbPagesMemory()
}
bool xmrig::VirtualMemory::adviseLargePages(void *p, size_t size)
{
# ifdef XMRIG_OS_LINUX
return (madvise(p, size, MADV_HUGEPAGE) == 0);
# else
return false;
# endif
}
void xmrig::VirtualMemory::freeLargePagesMemory()
{
if (m_flags.test(FLAG_LOCK)) {