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=1bd8601ce81500fc1ddf6584cd07379eec65083e;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);