From: Ulrich Drepper Date: Mon, 12 Sep 2005 14:02:35 +0000 (+0000) Subject: * malloc/malloc.c (struct malloc_chunk): Fix comment typo. X-Git-Tag: cvs/fedora-glibc-20051003T2040~95 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=9ea9af192bf0c2991db6e74cc95d83a69b02cf08;p=thirdparty%2Fglibc.git * malloc/malloc.c (struct malloc_chunk): Fix comment typo. (public_cALLOc): For mmapped chunks and perturb_byte != 0, don't clear SIZE_SZ bytes more than should be cleared. --- diff --git a/ChangeLog b/ChangeLog index 47ced660adc..91d90259c45 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2005-09-12 Jakub Jelinek + + * malloc/malloc.c (struct malloc_chunk): Fix comment typo. + (public_cALLOc): For mmapped chunks and perturb_byte != 0, + don't clear SIZE_SZ bytes more than should be cleared. + 2005-09-09 Jakub Jelinek * inet/getnetgrent_r.c: Include assert. diff --git a/malloc/malloc.c b/malloc/malloc.c index 65be2770974..64050b42663 100644 --- a/malloc/malloc.c +++ b/malloc/malloc.c @@ -1726,7 +1726,7 @@ struct malloc_chunk { mem-> +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | User data starts here... . . . - . (malloc_usable_space() bytes) . + . (malloc_usable_size() bytes) . . | nextchunk-> +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Size of chunk | @@ -3691,8 +3691,12 @@ public_cALLOc(size_t n, size_t elem_size) /* Two optional cases in which clearing not necessary */ #if HAVE_MMAP - if (perturb_byte == 0 && chunk_is_mmapped(p)) - return mem; + if (chunk_is_mmapped (p)) + { + if (__builtin_expect (perturb_byte, 0)) + MALLOC_ZERO (mem, sz); + return mem; + } #endif csz = chunksize(p);