memset freed blocks to 0xcd.
authorBen Pfaff <blp@cs.stanford.edu>
Wed, 22 Sep 2004 00:28:11 +0000 (00:28 +0000)
committerBen Pfaff <blp@cs.stanford.edu>
Wed, 22 Sep 2004 00:28:11 +0000 (00:28 +0000)
src/threads/malloc.c

index 9782a5a5ec161d70266d202e79c729c3b7b7d7da..9910bf433c7b1f2eac0a518de062a9a00ed7cafc 100644 (file)
@@ -177,8 +177,13 @@ free (void *p)
   a = block_to_arena (b);
   d = a->desc;
 
+#ifndef NDEBUG
+  memset (b, 0xcd, d->block_size);
+#endif
+  
   lock_acquire (&d->lock);
 
+
   /* Add block to free list. */
   list_push_front (&d->free_list, &b->free_elem);