Re: libiberty: Don't needlessly clear xmemdup allocated memory

2016-05-29 Thread DJ Delorie
Ok then. Thanks!

Re: libiberty: Don't needlessly clear xmemdup allocated memory

2016-05-29 Thread Alan Modra
On Sat, May 28, 2016 at 10:12:19PM -0400, DJ Delorie wrote: > > Alan Modra writes: > > * xmemdup.c (xmemdup): Use xmalloc rather than xcalloc. > > In glibc at least, calloc can be faster than memset if the kernel is > pre-zero-ing pages. Thus, in those cases, your change

Re: libiberty: Don't needlessly clear xmemdup allocated memory

2016-05-28 Thread DJ Delorie
Alan Modra writes: > * xmemdup.c (xmemdup): Use xmalloc rather than xcalloc. In glibc at least, calloc can be faster than memset if the kernel is pre-zero-ing pages. Thus, in those cases, your change makes the code slower by adding an unneeded memset. Have you

libiberty: Don't needlessly clear xmemdup allocated memory

2016-05-28 Thread Alan Modra
OK to apply? * xmemdup.c (xmemdup): Use xmalloc rather than xcalloc. diff --git a/libiberty/xmemdup.c b/libiberty/xmemdup.c index aa56f0b..4602afd 100644 --- a/libiberty/xmemdup.c +++ b/libiberty/xmemdup.c @@ -1,4 +1,4 @@ -/* xmemdup.c -- Duplicate a memory buffer, using xcalloc. +/*