From 0be7cabb49e3c947349c4d29b6051a671a213c50 Mon Sep 17 00:00:00 2001 From: Ulrich Weigand Date: Wed, 10 Nov 1999 19:59:32 +0000 Subject: [PATCH] When decommitting, remap zero pages using MAP_FIXED. --- memory/virtual.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/memory/virtual.c b/memory/virtual.c index f0083545cfe..f9f917a5afe 100644 --- a/memory/virtual.c +++ b/memory/virtual.c @@ -697,11 +697,11 @@ BOOL WINAPI VirtualFree( return TRUE; } - /* Decommit the pages by unmapping them and remapping zero-pages instead */ + /* Decommit the pages by remapping zero-pages instead */ - FILE_munmap( (LPVOID)base, 0, size ); if (FILE_dommap( -1, (LPVOID)base, 0, size, 0, 0, - VIRTUAL_GetUnixProt( 0 ), MAP_PRIVATE ) == (LPVOID)-1) + VIRTUAL_GetUnixProt( 0 ), MAP_PRIVATE|MAP_FIXED ) + != (LPVOID)base) ERR( "Could not remap pages, expect trouble\n" ); return VIRTUAL_SetProt( view, base, size, 0 ); }