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:
@@ -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)) {
|
||||
|
||||
Reference in New Issue
Block a user