Skip to content

Commit

Permalink
Only use MADV_RANDOM if defined
Browse files Browse the repository at this point in the history
needed to compile on Haiku.

fixes official-stockfish#3093

closes official-stockfish#3094

No functional change
  • Loading branch information
vondele committed Sep 2, 2020
1 parent a8bbaa1 commit be87517
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/syzygy/tbprobe.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,9 @@ class TBFile : public std::ifstream {

*mapping = statbuf.st_size;
*baseAddress = mmap(nullptr, statbuf.st_size, PROT_READ, MAP_SHARED, fd, 0);
#if defined(MADV_RANDOM)
madvise(*baseAddress, statbuf.st_size, MADV_RANDOM);
#endif
::close(fd);

if (*baseAddress == MAP_FAILED)
Expand Down

0 comments on commit be87517

Please sign in to comment.