CVS: winex/libs/ptmalloc3 malloc.c,1.1,1.2

[email protected]
Newsgroups gmane.comp.emulators.winex.cvs
Message-ID <[email protected]>
Subject: winex/libs/ptmalloc3 malloc.c,1.1,1.2Update of /var/lib/cvsd/cvsroot/winex/libs/ptmalloc3
In directory agravaine:/tmp/cvs-serv7209/libs/ptmalloc3

Modified Files:
	malloc.c 
Log Message:

- add +heapcheck debug channel to be used for behaviour-changing heap checks
- overwrite freed memory with 0x55 if +heapcheck is enabled


Index: malloc.c
===================================================================
RCS file: /var/lib/cvsd/cvsroot/winex/libs/ptmalloc3/malloc.c,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- malloc.c	30 Mar 2007 18:56:27 -0000	1.1
+++ malloc.c	30 Mar 2007 19:01:59 -0000	1.2
@@ -525,6 +525,7 @@
 #include <unistd.h>
 
 WINE_DEFAULT_DEBUG_CHANNEL(heap);
+WINE_DECLARE_DEBUG_CHANNEL(heapcheck);
 #endif
 
 #if defined(DARWIN) || defined(_DARWIN)
@@ -5124,6 +5125,10 @@
       if (RTCHECK(ok_address(fm, p) && ok_cinuse(p))) {
         size_t psize = chunksize(p);
         mchunkptr next = chunk_plus_offset(p, psize);
+
+        if (TRACE_ON (heapcheck))
+           memset (mem, 0xaa, psize - overhead_for (p));
+
         if (!pinuse(p)) {
           size_t prevsize = p->prev_foot;
           if ((prevsize & IS_MMAPPED_BIT) != 0) {
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.