summaryrefslogtreecommitdiffstats
path: root/Mac/mwerks
diff options
context:
space:
mode:
authorJack Jansen <jack.jansen@cwi.nl>1996-09-30 14:42:28 (GMT)
committerJack Jansen <jack.jansen@cwi.nl>1996-09-30 14:42:28 (GMT)
commit05cf7e040b79be2edef7c08e447edc6426db8530 (patch)
tree40fa91342e38b2017d04aea7eb569627b63a74f7 /Mac/mwerks
parente86cbc43f2ff8f278e44614de10090a410294e89 (diff)
downloadcpython-05cf7e040b79be2edef7c08e447edc6426db8530.zip
cpython-05cf7e040b79be2edef7c08e447edc6426db8530.tar.gz
cpython-05cf7e040b79be2edef7c08e447edc6426db8530.tar.bz2
Added VCHECK compile time option that fills allocated and freed blocks
with garbage.
Diffstat (limited to 'Mac/mwerks')
-rw-r--r--Mac/mwerks/malloc/malloc.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/Mac/mwerks/malloc/malloc.c b/Mac/mwerks/malloc/malloc.c
index cb9c0cf..897d500 100644
--- a/Mac/mwerks/malloc/malloc.c
+++ b/Mac/mwerks/malloc/malloc.c
@@ -57,6 +57,7 @@ static char *rcsid = "$Id$";
#define DEBUG2
#define MSTATS
#define RCHECK
+#define VCHECK
typedef unsigned char u_char;
typedef unsigned long u_long;
@@ -222,6 +223,9 @@ malloc(nbytes)
op->ov_rmagic = RMAGIC;
*(u_short *)((caddr_t)(op + 1) + op->ov_size) = RMAGIC;
#endif
+#ifdef VCHECK
+ memset((char *)(op+1), 0x41, nbytes);
+#endif
return ((char *)(op + 1));
}
@@ -287,6 +291,9 @@ free(cp)
ASSERT(op->ov_rmagic == RMAGIC);
ASSERT(*(u_short *)((caddr_t)(op + 1) + op->ov_size) == RMAGIC);
#endif
+#ifdef VCHECK
+ memset(cp, 43, op->ov_size);
+#endif
size = op->ov_index;
if ( size == 0xff ) {
#ifdef MSTATS