This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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


Alan Modra <amodra@gmail.com> 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?


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]