Never inline lookup_slow.

This commit is contained in:
Markus Reiter 2025-03-07 20:16:39 +01:00
parent 34ac75be28
commit 22725588d3
No known key found for this signature in database
2 changed files with 4 additions and 0 deletions

View file

@ -433,6 +433,8 @@ pub mod grapheme_extend {
pub fn lookup(c: char) -> bool {
(c as u32) >= 0x300 && lookup_slow(c)
}
#[inline(never)]
fn lookup_slow(c: char) -> bool {
const {
assert!(SHORT_OFFSET_RUNS.last().unwrap().0 > (char::MAX as u32));

View file

@ -105,6 +105,8 @@ impl RawEmitter {
writeln!(&mut self.file, " (c as u32) >= {first_code_point:#04x} && lookup_slow(c)")
.unwrap();
writeln!(&mut self.file, "}}").unwrap();
writeln!(&mut self.file).unwrap();
writeln!(&mut self.file, "#[inline(never)]").unwrap();
writeln!(&mut self.file, "fn lookup_slow(c: char) -> bool {{").unwrap();
} else {
writeln!(&mut self.file, "pub fn lookup(c: char) -> bool {{").unwrap();