aboutsummaryrefslogtreecommitdiff
path: root/src/common/linux/memory.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/common/linux/memory.h')
-rw-r--r--src/common/linux/memory.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/common/linux/memory.h b/src/common/linux/memory.h
index 7cae40ef..f10a194b 100644
--- a/src/common/linux/memory.h
+++ b/src/common/linux/memory.h
@@ -86,8 +86,13 @@ class PageAllocator {
private:
uint8_t *GetNPages(unsigned num_pages) {
+#ifdef __x86_64
+ void *a = sys_mmap(NULL, page_size_ * num_pages, PROT_READ | PROT_WRITE,
+ MAP_PRIVATE | MAP_ANONYMOUS, -1, 0);
+#else
void *a = sys_mmap2(NULL, page_size_ * num_pages, PROT_READ | PROT_WRITE,
MAP_PRIVATE | MAP_ANONYMOUS, -1, 0);
+#endif
if (a == MAP_FAILED)
return NULL;