Skip to content

Commit 1d818a4

Browse files
committed
Support 16 bit platforms
1 parent f8f2888 commit 1d818a4

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/libcore/slice/memchr.rs

+6
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,12 @@ fn contains_zero_byte(x: usize) -> bool {
3333
x.wrapping_sub(LO_USIZE) & !x & HI_USIZE != 0
3434
}
3535

36+
#[cfg(target_pointer_width = "16")]
37+
#[inline]
38+
fn repeat_byte(b: u8) -> usize {
39+
(b as usize) << 8 | b as usize
40+
}
41+
3642
#[cfg(target_pointer_width = "32")]
3743
#[inline]
3844
fn repeat_byte(b: u8) -> usize {

0 commit comments

Comments
 (0)