blob: 78d65ee7dfa5ada6ba94dde28fc1602a7c30b59d (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
|
Some mmap(2) flags are Linux-specific but otherwise not required
core/os_interface/linux/os_memory_linux.cpp:17:83: error:
use of undeclared identifier 'MAP_NORESERVE'
return mmapWrapper(0, sizeToReserve, PROT_NONE, MAP_PRIVATE | MAP_ANONYMOUS | MAP_NORESERVE | MAP_...
^
core/os_interface/linux/os_memory_linux.cpp:17:99: error:
use of undeclared identifier 'MAP_HUGETLB'
...mmapWrapper(0, sizeToReserve, PROT_NONE, MAP_PRIVATE | MAP_ANONYMOUS | MAP_NORESERVE | MAP_HUGETLB, -1...
^
--- shared/source/os_interface/linux/os_memory_linux.cpp.orig 2020-02-28 16:16:42 UTC
+++ shared/source/os_interface/linux/os_memory_linux.cpp
@@ -7,6 +7,17 @@
#include "shared/source/os_interface/linux/os_memory_linux.h"
+#ifdef MAP_ALIGNED_SUPER
+#define MAP_HUGETLB MAP_ALIGNED_SUPER // FreeBSD
+#endif
+
+#ifndef MAP_NORESERVE
+#define MAP_NORESERVE 0
+#endif
+#ifndef MAP_HUGETLB
+#define MAP_HUGETLB 0
+#endif
+
namespace NEO {
std::unique_ptr<OSMemory> OSMemory::create() {
|