projects
/
pintos-anon
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
3fb471c
)
memset freed blocks to 0xcd.
author
Ben Pfaff
<blp@cs.stanford.edu>
Wed, 22 Sep 2004 00:28:11 +0000
(
00:28
+0000)
committer
Ben Pfaff
<blp@cs.stanford.edu>
Wed, 22 Sep 2004 00:28:11 +0000
(
00:28
+0000)
src/threads/malloc.c
patch
|
blob
|
history
diff --git
a/src/threads/malloc.c
b/src/threads/malloc.c
index 9782a5a5ec161d70266d202e79c729c3b7b7d7da..9910bf433c7b1f2eac0a518de062a9a00ed7cafc 100644
(file)
--- 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);