This repository was archived by the owner on May 28, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +3
-1
lines changed
library/std/src/io/buffered Expand file tree Collapse file tree 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> {
351351 // If this function ends up being called frequently relative to `write`,
352352 // it's likely a sign that the client is using an improperly sized buffer
353353 // or their write patterns are somewhat pathological.
354+ #[ cold]
354355 #[ inline( never) ]
355356 fn write_cold ( & mut self , buf : & [ u8 ] ) -> io:: Result < usize > {
356357 if buf. len ( ) > self . spare_capacity ( ) {
@@ -385,6 +386,7 @@ impl<W: Write> BufWriter<W> {
385386 // If this function ends up being called frequently relative to `write_all`,
386387 // it's likely a sign that the client is using an improperly sized buffer
387388 // or their write patterns are somewhat pathological.
389+ #[ cold]
388390 #[ inline( never) ]
389391 fn write_all_cold ( & mut self , buf : & [ u8 ] ) -> io:: Result < ( ) > {
390392 // Normally, `write_all` just calls `write` in a loop. We can do better
@@ -421,7 +423,7 @@ impl<W: Write> BufWriter<W> {
421423
422424 // SAFETY: Requires `buf.len() <= self.buf.capacity() - self.buf.len()`,
423425 // i.e., that input buffer length is less than or equal to spare capacity.
424- #[ inline( always ) ]
426+ #[ inline]
425427 unsafe fn write_to_buffer_unchecked ( & mut self , buf : & [ u8 ] ) {
426428 debug_assert ! ( buf. len( ) <= self . spare_capacity( ) ) ;
427429 let old_len = self . buf . len ( ) ;
You can’t perform that action at this time.
0 commit comments