From cbdfa8402603e3a756b10d1527f1dc3c594f57cd Mon Sep 17 00:00:00 2001 From: iximeow Date: Tue, 18 Jun 2024 22:07:00 -0700 Subject: inline the write u8/u32 helpers, lets see what that does --- src/long_mode/display.rs | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src') diff --git a/src/long_mode/display.rs b/src/long_mode/display.rs index 4f80950..1d14ff8 100644 --- a/src/long_mode/display.rs +++ b/src/long_mode/display.rs @@ -740,6 +740,7 @@ impl DisplaySink for alloc::string::String { /// this is provided for optimization opportunities when the formatted integer can be written /// directly to the sink (rather than formatted to an intermediate buffer and output as a /// followup step) + #[inline(always)] fn write_u8(&mut self, mut v: u8) -> Result<(), core::fmt::Error> { // we can fairly easily predict the size of a formatted string here with lzcnt, which also // means we can write directly into the correct offsets of the output string. @@ -803,6 +804,7 @@ impl DisplaySink for alloc::string::String { /// this is provided for optimization opportunities when the formatted integer can be written /// directly to the sink (rather than formatted to an intermediate buffer and output as a /// followup step) + #[inline(always)] fn write_u32(&mut self, mut v: u32) -> Result<(), core::fmt::Error> { // we can fairly easily predict the size of a formatted string here with lzcnt, which also // means we can write directly into the correct offsets of the output string. @@ -1073,6 +1075,7 @@ impl DisplaySink for BigEnoughString { /// this is provided for optimization opportunities when the formatted integer can be written /// directly to the sink (rather than formatted to an intermediate buffer and output as a /// followup step) + #[inline(always)] fn write_u8(&mut self, mut v: u8) -> Result<(), core::fmt::Error> { // we can fairly easily predict the size of a formatted string here with lzcnt, which also // means we can write directly into the correct offsets of the output string. @@ -1133,6 +1136,7 @@ impl DisplaySink for BigEnoughString { /// this is provided for optimization opportunities when the formatted integer can be written /// directly to the sink (rather than formatted to an intermediate buffer and output as a /// followup step) + #[inline(always)] fn write_u32(&mut self, mut v: u32) -> Result<(), core::fmt::Error> { // we can fairly easily predict the size of a formatted string here with lzcnt, which also // means we can write directly into the correct offsets of the output string. -- cgit v1.1