Remove xsputn small copy optimization.
* libio/fileops.c (_IO_new_file_xsputn): Don't try to optimize small copies by hand.
This commit is contained in:
parent
984a42374c
commit
20fde22738
|
@ -1,3 +1,8 @@
|
||||||
|
2012-03-29 David S. Miller <davem@davemloft.net>
|
||||||
|
|
||||||
|
* libio/fileops.c (_IO_new_file_xsputn): Don't try to optimize
|
||||||
|
small copies by hand.
|
||||||
|
|
||||||
2012-03-28 Siddhesh Poyarekar <siddhesh@redhat.com>
|
2012-03-28 Siddhesh Poyarekar <siddhesh@redhat.com>
|
||||||
|
|
||||||
[BZ #13761]
|
[BZ #13761]
|
||||||
|
|
|
@ -1341,24 +1341,13 @@ _IO_new_file_xsputn (f, data, n)
|
||||||
{
|
{
|
||||||
if (count > to_do)
|
if (count > to_do)
|
||||||
count = to_do;
|
count = to_do;
|
||||||
if (count > 20)
|
|
||||||
{
|
|
||||||
#ifdef _LIBC
|
#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
|
#else
|
||||||
memcpy (f->_IO_write_ptr, s, count);
|
memcpy (f->_IO_write_ptr, s, count);
|
||||||
f->_IO_write_ptr += count;
|
f->_IO_write_ptr += count;
|
||||||
#endif
|
#endif
|
||||||
s += count;
|
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;
|
|
||||||
}
|
|
||||||
to_do -= count;
|
to_do -= count;
|
||||||
}
|
}
|
||||||
if (to_do + must_flush > 0)
|
if (to_do + must_flush > 0)
|
||||||
|
|
Loading…
Reference in New Issue