Skip to content

Commit d0e9e5f

Browse files
bors[bot]rcls
andauthored
Merge #515
515: Add `#[inline(always)]` to three generated methods. r=burrbull a=rcls All three appear to be trivial wrappers, making the inline useful. These showed up inspecting the assembly for an interrupt handler requiring sub-µs turn-around times, so fairly critical for that application. Co-authored-by: Ralph Loader <ralph1loader@gmail.com>
2 parents 3767036 + 702a130 commit d0e9e5f

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/generate/register.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@ pub fn render(
7070
}
7171

7272
impl From<crate::R<#name_uc_spec>> for R {
73+
#[inline(always)]
7374
fn from(reader: crate::R<#name_uc_spec>) -> Self {
7475
R(reader)
7576
}
@@ -101,6 +102,7 @@ pub fn render(
101102
}
102103

103104
impl From<crate::W<#name_uc_spec>> for W {
105+
#[inline(always)]
104106
fn from(writer: crate::W<#name_uc_spec>) -> Self {
105107
W(writer)
106108
}
@@ -161,6 +163,7 @@ pub fn render(
161163

162164
mod_items.extend(quote! {
163165
#[doc = "Writes raw bits to the register."]
166+
#[inline(always)]
164167
pub unsafe fn bits(&mut self, bits: #rty) -> &mut Self {
165168
self.0.bits(bits);
166169
self

0 commit comments

Comments
 (0)