Skip to content

Commit

Permalink
Added an else branch in the code for Macs.
Browse files Browse the repository at this point in the history
  • Loading branch information
Wolf committed Jun 6, 2014
1 parent d547f95 commit 52ef283
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion cryptonight_common.c
Original file line number Diff line number Diff line change
Expand Up @@ -64,9 +64,11 @@ int scanhash_cryptonight(int thr_id, uint32_t *restrict pdata, const uint32_t *r
#if defined __unix__ && (!defined __APPLE__)
persistentctx = (struct cryptonight_ctx *)mmap(0, sizeof(struct cryptonight_ctx), PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_ANONYMOUS | MAP_HUGETLB | MAP_POPULATE, 0, 0);
if(persistentctx == MAP_FAILED) persistentctx = (struct cryptonight_ctx *)malloc(sizeof(struct cryptonight_ctx));
#else
#elsif defined _WIN32
persistentctx = VirtualAlloc(NULL, sizeof(struct cryptonight_ctx), MEM_LARGE_PAGES, PAGE_READWRITE);
if(!persistentctx) persistentctx = (struct cryptonight_ctx *)malloc(sizeof(struct cryptonight_ctx));
#else
persistentctx = (struct cryptonight_ctx *)malloc(sizeof(struct cryptonight_ctx));
#endif
}

Expand Down

0 comments on commit 52ef283

Please sign in to comment.