]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Added VCHECK compile time option that fills allocated and freed blocks
authorJack Jansen <jack.jansen@cwi.nl>
Mon, 30 Sep 1996 14:42:28 +0000 (14:42 +0000)
committerJack Jansen <jack.jansen@cwi.nl>
Mon, 30 Sep 1996 14:42:28 +0000 (14:42 +0000)
with garbage.

Mac/mwerks/malloc/malloc.c

index cb9c0cfb982c866a9415087d98b0421f30a5a147..897d500cb51b31a4a9bb374d861c9889be0958c6 100644 (file)
@@ -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;
@@ -221,6 +222,9 @@ malloc(nbytes)
        op->ov_size = (nbytes + RSLOP - 1) & ~(RSLOP - 1);
        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));
 }
@@ -286,6 +290,9 @@ free(cp)
 #ifdef RCHECK
        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 ) {