From: Ben Pfaff Date: Wed, 22 Sep 2004 00:28:11 +0000 (+0000) Subject: memset freed blocks to 0xcd. X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=941176f575fe512be8556f178ca1d7b42fe929f8;p=pintos-anon memset freed blocks to 0xcd. --- diff --git a/src/threads/malloc.c b/src/threads/malloc.c index 9782a5a..9910bf4 100644 --- a/src/threads/malloc.c +++ b/src/threads/malloc.c @@ -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);