mirror of
https://github.com/opelly27/Stockfish.git
synced 2026-05-20 03:57:45 +00:00
Deal with very old linux kernels
MADV_HUGEPAGE might not be available, for kernels before 2.6.38 (released 2011). Just skip the madvise. closes https://github.com/official-stockfish/Stockfish/pull/3039 No functional change
This commit is contained in:
@@ -367,7 +367,9 @@ void* aligned_ttmem_alloc(size_t allocSize, void*& mem) {
|
|||||||
size_t size = ((allocSize + alignment - 1) / alignment) * alignment; // multiple of alignment
|
size_t size = ((allocSize + alignment - 1) / alignment) * alignment; // multiple of alignment
|
||||||
if (posix_memalign(&mem, alignment, size))
|
if (posix_memalign(&mem, alignment, size))
|
||||||
mem = nullptr;
|
mem = nullptr;
|
||||||
|
#if defined(MADV_HUGEPAGE)
|
||||||
madvise(mem, allocSize, MADV_HUGEPAGE);
|
madvise(mem, allocSize, MADV_HUGEPAGE);
|
||||||
|
#endif
|
||||||
return mem;
|
return mem;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user