Sources Bugzilla – Bug 14317
__xpg_strerror_r not fully optimized
Last modified: 2012-12-27 21:42:42 UTC
The implementation of __xpg_strerror_r spends time doing an strlen call, and then potentially returning before the value is actually used. This can be optimized.
Created attachment 6502 [details] proposed fix
Bruno, Fold the copyright years together e.g. 1991-2012. If you haven't posted this to libc-alpha, please do and I'll ack. This looks like a straight forward and useful optimization.
I cleaned up the patch and send it to libc-alpha myself.
Targeting for 2.18 now.
Committed for glibc 2.18: commit 7fffbdfff7d39cec0783e5b9381fa4093484c235 Author: 2012-12-27 Bruno Haible <bruno@clisp.org> Date: Thu Dec 27 22:37:39 2012 +0100 BZ#14317: Optimze __xpg_strerror_r [BZ #14317] * string/xpg-strerror.c (__xpg_strerror_r): Optimize, call strlen only if needed. thanks for the patch!