summaryrefslogtreecommitdiff
path: root/monitor_mm.c
diff options
context:
space:
mode:
Diffstat (limited to 'monitor_mm.c')
-rw-r--r--monitor_mm.c10
1 files changed, 2 insertions, 8 deletions
diff --git a/monitor_mm.c b/monitor_mm.c
index f72a180ea..fb5f2c82c 100644
--- a/monitor_mm.c
+++ b/monitor_mm.c
@@ -91,15 +91,9 @@ mm_create(struct mm_master *mmalloc, size_t size)
91 */ 91 */
92 mm->mmalloc = mmalloc; 92 mm->mmalloc = mmalloc;
93 93
94#ifdef HAVE_MMAP_ANON_SHARED 94 address = xmmap(size);
95 address = mmap(NULL, size, PROT_WRITE|PROT_READ, MAP_ANON|MAP_SHARED,
96 -1, 0);
97 if (address == MAP_FAILED) 95 if (address == MAP_FAILED)
98 fatal("mmap(%lu): %s", (u_long)size, strerror(errno)); 96 fatal("mmap(%lu): %s", (u_long)size, strerror(errno));
99#else
100 fatal("%s: UsePrivilegeSeparation=yes and Compression=yes not supported",
101 __func__);
102#endif
103 97
104 mm->address = address; 98 mm->address = address;
105 mm->size = size; 99 mm->size = size;
@@ -137,7 +131,7 @@ mm_destroy(struct mm_master *mm)
137 mm_freelist(mm->mmalloc, &mm->rb_free); 131 mm_freelist(mm->mmalloc, &mm->rb_free);
138 mm_freelist(mm->mmalloc, &mm->rb_allocated); 132 mm_freelist(mm->mmalloc, &mm->rb_allocated);
139 133
140#ifdef HAVE_MMAP_ANON_SHARED 134#ifdef HAVE_MMAP
141 if (munmap(mm->address, mm->size) == -1) 135 if (munmap(mm->address, mm->size) == -1)
142 fatal("munmap(%p, %lu): %s", mm->address, (u_long)mm->size, 136 fatal("munmap(%p, %lu): %s", mm->address, (u_long)mm->size,
143 strerror(errno)); 137 strerror(errno));