File tree 1 file changed +3
-1
lines changed
library/std/src/io/buffered
1 file changed +3
-1
lines changed Original file line number Diff line number Diff line change @@ -351,6 +351,7 @@ impl<W: Write> BufWriter<W> {
351
351
// If this function ends up being called frequently relative to `write`,
352
352
// it's likely a sign that the client is using an improperly sized buffer
353
353
// or their write patterns are somewhat pathological.
354
+ #[ cold]
354
355
#[ inline( never) ]
355
356
fn write_cold ( & mut self , buf : & [ u8 ] ) -> io:: Result < usize > {
356
357
if buf. len ( ) > self . spare_capacity ( ) {
@@ -385,6 +386,7 @@ impl<W: Write> BufWriter<W> {
385
386
// If this function ends up being called frequently relative to `write_all`,
386
387
// it's likely a sign that the client is using an improperly sized buffer
387
388
// or their write patterns are somewhat pathological.
389
+ #[ cold]
388
390
#[ inline( never) ]
389
391
fn write_all_cold ( & mut self , buf : & [ u8 ] ) -> io:: Result < ( ) > {
390
392
// Normally, `write_all` just calls `write` in a loop. We can do better
@@ -421,7 +423,7 @@ impl<W: Write> BufWriter<W> {
421
423
422
424
// SAFETY: Requires `buf.len() <= self.buf.capacity() - self.buf.len()`,
423
425
// i.e., that input buffer length is less than or equal to spare capacity.
424
- #[ inline( always ) ]
426
+ #[ inline]
425
427
unsafe fn write_to_buffer_unchecked ( & mut self , buf : & [ u8 ] ) {
426
428
debug_assert ! ( buf. len( ) <= self . spare_capacity( ) ) ;
427
429
let old_len = self . buf . len ( ) ;
You can’t perform that action at this time.
0 commit comments