From: David S. Miller Date: Thu, 29 Mar 2012 21:38:27 +0000 (-0700) Subject: Remove xsputn small copy optimization. X-Git-Tag: upstream/2.30~11315 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=20fde227388fb0c2857ff1793754056b833697fe;p=external%2Fglibc.git Remove xsputn small copy optimization. * libio/fileops.c (_IO_new_file_xsputn): Don't try to optimize small copies by hand. --- diff --git a/ChangeLog b/ChangeLog index 165a178..ec22026 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2012-03-29 David S. Miller + + * libio/fileops.c (_IO_new_file_xsputn): Don't try to optimize + small copies by hand. + 2012-03-28 Siddhesh Poyarekar [BZ #13761] diff --git a/libio/fileops.c b/libio/fileops.c index 95e09b4..a2e8dac 100644 --- a/libio/fileops.c +++ b/libio/fileops.c @@ -1341,24 +1341,13 @@ _IO_new_file_xsputn (f, data, n) { if (count > to_do) count = to_do; - if (count > 20) - { #ifdef _LIBC - f->_IO_write_ptr = __mempcpy (f->_IO_write_ptr, s, count); + f->_IO_write_ptr = __mempcpy (f->_IO_write_ptr, s, count); #else - memcpy (f->_IO_write_ptr, s, count); - f->_IO_write_ptr += count; + memcpy (f->_IO_write_ptr, s, count); + f->_IO_write_ptr += count; #endif - s += count; - } - else - { - register char *p = f->_IO_write_ptr; - register int i = (int) count; - while (--i >= 0) - *p++ = *s++; - f->_IO_write_ptr = p; - } + s += count; to_do -= count; } if (to_do + must_flush > 0)