mirror of
https://github.com/sockspls/badfish
synced 2025-04-30 08:43:09 +00:00
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
This commit is contained in:
parent
a8bbaa1795
commit
be87517734
1 changed files with 2 additions and 0 deletions
|
@ -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)
|
||||
|
|
Loading…
Add table
Reference in a new issue