aboutsummaryrefslogtreecommitdiff
path: root/exec.c
diff options
context:
space:
mode:
Diffstat (limited to 'exec.c')
-rw-r--r--exec.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/exec.c b/exec.c
index d9be5752c5..076d26b5ba 100644
--- a/exec.c
+++ b/exec.c
@@ -2412,6 +2412,9 @@ ram_addr_t qemu_ram_alloc(ram_addr_t size)
new_block = qemu_malloc(sizeof(*new_block));
new_block->host = qemu_vmalloc(size);
+#ifdef MADV_MERGEABLE
+ madvise(new_block->host, size, MADV_MERGEABLE);
+#endif
new_block->offset = last_ram_offset;
new_block->length = size;