This is the mail archive of the
mailing list for the binutils project.
Re: libiberty: Don't needlessly clear xmemdup allocated memory
- From: DJ Delorie <dj at redhat dot com>
- To: Alan Modra <amodra at gmail dot com>
- Cc: gcc-patches at gcc dot gnu dot org, binutils at sourceware dot org
- Date: Sat, 28 May 2016 22:12:19 -0400
- Subject: Re: libiberty: Don't needlessly clear xmemdup allocated memory
- Authentication-results: sourceware.org; auth=none
Alan Modra <firstname.lastname@example.org> 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 considered these cases?