Update slow-hash.c

1. Fix for Mac OSX compilation errors.
This commit is contained in:
NoodleDoodleNoodleDoodleNoodleDoodleNoo 2014-06-19 23:49:25 -07:00
parent 05a5c62fe8
commit e12ccdf905

View File

@ -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