projects
/
fairystockfish.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
(parent:
daac866
)
Deal with very old linux kernels
author
Joost VandeVondele
<Joost.VandeVondele@gmail.com>
Fri, 21 Aug 2020 05:42:19 +0000 (07:42 +0200)
committer
Joost VandeVondele
<Joost.VandeVondele@gmail.com>
Fri, 21 Aug 2020 15:56:33 +0000 (17:56 +0200)
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
src/misc.cpp
patch
|
blob
|
history
diff --git
a/src/misc.cpp
b/src/misc.cpp
index
459ea10
..
56a3dca
100644
(file)
--- a/
src/misc.cpp
+++ b/
src/misc.cpp
@@
-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;
}