Alexandre Julliard : ntdll: Use the same value as Windows for filling free heap blocks.

Alexandre Julliard julliard at winehq.org
Tue Jan 26 11:21:09 CST 2010


Module: wine
Branch: master
Commit: c15660054f70c69d8b4f72a4ad98d4bd59301023
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=c15660054f70c69d8b4f72a4ad98d4bd59301023

Author: Alexandre Julliard <julliard at winehq.org>
Date:   Tue Jan 26 14:30:25 2010 +0100

ntdll: Use the same value as Windows for filling free heap blocks.

---

 dlls/ntdll/heap.c |    8 ++++++--
 1 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/dlls/ntdll/heap.c b/dlls/ntdll/heap.c
index 2f45943..d8291b8 100644
--- a/dlls/ntdll/heap.c
+++ b/dlls/ntdll/heap.c
@@ -85,7 +85,7 @@ typedef struct
 
 #define ARENA_INUSE_FILLER     0x55
 #define ARENA_TAIL_FILLER      0xab
-#define ARENA_FREE_FILLER      0xaa
+#define ARENA_FREE_FILLER      0xfeeefeee
 
 /* everything is aligned on 8 byte boundaries (16 for Win64) */
 #define ALIGNMENT              (2*sizeof(void*))
@@ -169,7 +169,11 @@ static BOOL HEAP_IsRealArena( HEAP *heapPtr, DWORD flags, LPCVOID block, BOOL qu
 /* mark a block of memory as free for debugging purposes */
 static inline void mark_block_free( void *ptr, SIZE_T size, DWORD flags )
 {
-    if (flags & HEAP_FREE_CHECKING_ENABLED) memset( ptr, ARENA_FREE_FILLER, size );
+    if (flags & HEAP_FREE_CHECKING_ENABLED)
+    {
+        SIZE_T i;
+        for (i = 0; i < size / sizeof(DWORD); i++) ((DWORD *)ptr)[i] = ARENA_FREE_FILLER;
+    }
 #if defined(VALGRIND_MAKE_MEM_NOACCESS)
     VALGRIND_DISCARD( VALGRIND_MAKE_MEM_NOACCESS( ptr, size ));
 #elif defined( VALGRIND_MAKE_NOACCESS)




More information about the wine-cvs mailing list