Fixed for hugepages on cn-turtle
This commit is contained in:
parent
651e650037
commit
20e7d62ec7
2 changed files with 3 additions and 2 deletions
|
@ -62,7 +62,6 @@ ScratchPadMem Mem::create(ScratchPad** scratchPads, int threadId)
|
|||
ScratchPadMem scratchPadMem;
|
||||
scratchPadMem.realSize = scratchPadSize * getThreadHashFactor(threadId);
|
||||
scratchPadMem.size = scratchPadSize * getThreadHashFactor(threadId);
|
||||
scratchPadMem.size += scratchPadMem.size % MEMORY;
|
||||
scratchPadMem.pages = std::max(scratchPadMem.size / MEMORY, static_cast<size_t>(1));
|
||||
|
||||
allocate(scratchPadMem, m_useHugePages);
|
||||
|
|
|
@ -21,7 +21,7 @@
|
|||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
|
||||
#include <algorithm>
|
||||
#include <winsock2.h>
|
||||
#include <windows.h>
|
||||
#include <ntsecapi.h>
|
||||
|
@ -159,6 +159,8 @@ void Mem::allocate(ScratchPadMem& scratchPadMem, bool useHugePages)
|
|||
return;
|
||||
}
|
||||
|
||||
scratchPadMem.size = std::max(scratchPadMem.size, static_cast<size_t>(MEMORY));
|
||||
|
||||
scratchPadMem.memory = static_cast<uint8_t*>(VirtualAlloc(nullptr, scratchPadMem.size, MEM_COMMIT | MEM_RESERVE | MEM_LARGE_PAGES, PAGE_READWRITE));
|
||||
if (scratchPadMem.memory) {
|
||||
scratchPadMem.hugePages = scratchPadMem.pages;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue