Update slow-hash.c
1. Fix for Mac OSX compilation errors.
This commit is contained in:
parent
05a5c62fe8
commit
e12ccdf905
1 changed files with 5 additions and 0 deletions
|
@ -303,9 +303,14 @@ void slow_hash_allocate_state(void)
|
||||||
SetLockPagesPrivilege(GetCurrentProcess(), TRUE);
|
SetLockPagesPrivilege(GetCurrentProcess(), TRUE);
|
||||||
hp_state = (uint8_t *) VirtualAlloc(hp_state, MEMORY, MEM_LARGE_PAGES |
|
hp_state = (uint8_t *) VirtualAlloc(hp_state, MEMORY, MEM_LARGE_PAGES |
|
||||||
MEM_COMMIT | MEM_RESERVE, PAGE_READWRITE);
|
MEM_COMMIT | MEM_RESERVE, PAGE_READWRITE);
|
||||||
|
#else
|
||||||
|
#if defined(__APPLE__)
|
||||||
|
hp_state = mmap(0, MEMORY, PROT_READ | PROT_WRITE,
|
||||||
|
MAP_PRIVATE | MAP_ANON, 0, 0);
|
||||||
#else
|
#else
|
||||||
hp_state = mmap(0, MEMORY, PROT_READ | PROT_WRITE,
|
hp_state = mmap(0, MEMORY, PROT_READ | PROT_WRITE,
|
||||||
MAP_PRIVATE | MAP_ANONYMOUS | MAP_HUGETLB, 0, 0);
|
MAP_PRIVATE | MAP_ANONYMOUS | MAP_HUGETLB, 0, 0);
|
||||||
|
#endif
|
||||||
if(hp_state == MAP_FAILED)
|
if(hp_state == MAP_FAILED)
|
||||||
hp_state = NULL;
|
hp_state = NULL;
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Reference in a new issue