X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Fthreads%2Fmalloc.c;h=8e6b4591ea87ecae09337ae5d741c89a68bdcb9a;hb=2eda07105e94747981c8b813dee62e512b496460;hp=20773548d9ee2499b68a22e89e3b222694ef985c;hpb=1301e0ec8533a8c2f1f61b70459444b6a49e7ba6;p=pintos-anon diff --git a/src/threads/malloc.c b/src/threads/malloc.c index 2077354..8e6b459 100644 --- a/src/threads/malloc.c +++ b/src/threads/malloc.c @@ -161,7 +161,7 @@ calloc (size_t a, size_t b) void *p; size_t size; - /* Calculate block size. */ + /* Calculate block size and make sure it fits in size_t. */ size = a * b; if (size < a || size < b) return NULL; @@ -198,7 +198,7 @@ free (void *p) } #ifndef NDEBUG - memset (b, 0xcd, d->block_size); + memset (b, 0xcc, d->block_size); #endif lock_acquire (&d->lock);