• Home
  • Raw
  • Download

Lines Matching refs:usize

6 use core::usize;
9 const USIZE_BYTES: usize = 2;
12 const USIZE_BYTES: usize = 4;
15 const USIZE_BYTES: usize = 8;
18 const LOOP_SIZE: usize = 2 * USIZE_BYTES;
28 fn contains_zero_byte(x: usize) -> bool { in contains_zero_byte()
32 const LO_USIZE: usize = LO_U64 as usize; in contains_zero_byte()
33 const HI_USIZE: usize = HI_U64 as usize; in contains_zero_byte()
43 fn repeat_byte(b: u8) -> usize { in repeat_byte() argument
44 (b as usize) * (usize::MAX / 255) in repeat_byte()
47 pub fn memchr(n1: u8, haystack: &[u8]) -> Option<usize> { in memchr() argument
61 let chunk = (ptr as *const usize).read_unaligned(); in memchr() constant
66 ptr = ptr.add(USIZE_BYTES - (start_ptr as usize & align)); in memchr()
70 debug_assert_eq!(0, (ptr as usize) % USIZE_BYTES); in memchr()
72 let a = *(ptr as *const usize); in memchr() constant
73 let b = *(ptr.add(USIZE_BYTES) as *const usize); in memchr() constant
86 pub fn memchr2(n1: u8, n2: u8, haystack: &[u8]) -> Option<usize> { in memchr2() argument
100 let chunk = (ptr as *const usize).read_unaligned(); in memchr2() constant
107 ptr = ptr.add(USIZE_BYTES - (start_ptr as usize & align)); in memchr2()
111 debug_assert_eq!(0, (ptr as usize) % USIZE_BYTES); in memchr2()
113 let chunk = *(ptr as *const usize); in memchr2() constant
126 pub fn memchr3(n1: u8, n2: u8, n3: u8, haystack: &[u8]) -> Option<usize> { in memchr3() argument
141 let chunk = (ptr as *const usize).read_unaligned(); in memchr3() constant
149 ptr = ptr.add(USIZE_BYTES - (start_ptr as usize & align)); in memchr3()
153 debug_assert_eq!(0, (ptr as usize) % USIZE_BYTES); in memchr3()
155 let chunk = *(ptr as *const usize); in memchr3() constant
169 pub fn memrchr(n1: u8, haystack: &[u8]) -> Option<usize> { in memrchr() argument
183 let chunk = (ptr.sub(USIZE_BYTES) as *const usize).read_unaligned(); in memrchr() constant
188 ptr = (end_ptr as usize & !align) as *const u8; in memrchr()
191 debug_assert_eq!(0, (ptr as usize) % USIZE_BYTES); in memrchr()
193 let a = *(ptr.sub(2 * USIZE_BYTES) as *const usize); in memrchr() constant
194 let b = *(ptr.sub(1 * USIZE_BYTES) as *const usize); in memrchr() constant
207 pub fn memrchr2(n1: u8, n2: u8, haystack: &[u8]) -> Option<usize> { in memrchr2() argument
221 let chunk = (ptr.sub(USIZE_BYTES) as *const usize).read_unaligned(); in memrchr2() constant
228 ptr = (end_ptr as usize & !align) as *const u8; in memrchr2()
231 debug_assert_eq!(0, (ptr as usize) % USIZE_BYTES); in memrchr2()
233 let chunk = *(ptr.sub(USIZE_BYTES) as *const usize); in memrchr2() constant
246 pub fn memrchr3(n1: u8, n2: u8, n3: u8, haystack: &[u8]) -> Option<usize> { in memrchr3() argument
261 let chunk = (ptr.sub(USIZE_BYTES) as *const usize).read_unaligned(); in memrchr3() constant
269 ptr = (end_ptr as usize & !align) as *const u8; in memrchr3()
272 debug_assert_eq!(0, (ptr as usize) % USIZE_BYTES); in memrchr3()
274 let chunk = *(ptr.sub(USIZE_BYTES) as *const usize); in memrchr3() constant
293 ) -> Option<usize> { in forward_search() argument
312 ) -> Option<usize> { in reverse_search() argument
327 fn sub(a: *const u8, b: *const u8) -> usize { in sub() argument
329 (a as usize) - (b as usize) in sub()