Skip to contentSkip to conversation

mmap.c: Reuse unmapped memory areas.

PATCH New Edgar E. Iglesias 1 participant 1 message Feb 16, 2008

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 mmap.c: Reuse unmapped memory areas.

Try to rewind mmap_next_start when unmapping memory. Simple tests in test-mmap.c now pass.

Best regards

Signature · 2 lines
Edgar E. Iglesias
Axis Communications AB
linux-user/mmap.c +3 -0
index 6292826..78a8162 100644
@@ -385,6 +385,9 @@ int target_munmap(abi_ulong start, abi_ulong len)
             real_end -= qemu_host_page_size;
     }
 
+    if (start < mmap_next_start)
+    	mmap_next_start = start;
+
     /* unmap what we can */
     if (real_start < real_end) {
         ret = munmap(g2h(real_start), real_end - real_start);