(public_cALLOc): For mmapped chunks and perturb_byte != 0,
don't clear SIZE_SZ bytes more than should be cleared.
+2005-09-12 Jakub Jelinek <jakub@redhat.com>
+
+ * 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 <jakub@redhat.com>
* inet/getnetgrent_r.c: Include assert.
mem-> +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| User data starts here... .
. .
- . (malloc_usable_space() bytes) .
+ . (malloc_usable_size() bytes) .
. |
nextchunk-> +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Size of chunk |
/* 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);