1
0
Fork 0

Only use MADV_RANDOM if defined

needed to compile on Haiku.

fixes https://github.com/official-stockfish/Stockfish/issues/3093

closes https://github.com/official-stockfish/Stockfish/pull/3094

No functional change
pull/3095/head
Joost VandeVondele 2020-09-01 12:22:47 +02:00
parent a8bbaa1795
commit be87517734
1 changed files with 2 additions and 0 deletions

View File

@ -223,7 +223,9 @@ public:
*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)