mirror of
https://github.com/sockspls/badfish
synced 2025-04-30 16:53:09 +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:
parent
daac86691d
commit
8b45b1c490
1 changed files with 2 additions and 0 deletions
|
@ -367,7 +367,9 @@ void* aligned_ttmem_alloc(size_t allocSize, void*& mem) {
|
|||
size_t size = ((allocSize + alignment - 1) / alignment) * alignment; // multiple of alignment
|
||||
if (posix_memalign(&mem, alignment, size))
|
||||
mem = nullptr;
|
||||
#if defined(MADV_HUGEPAGE)
|
||||
madvise(mem, allocSize, MADV_HUGEPAGE);
|
||||
#endif
|
||||
return mem;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue