File tree 1 file changed +15
-0
lines changed
1 file changed +15
-0
lines changed Original file line number Diff line number Diff line change @@ -445,7 +445,22 @@ impl<'a> SliceRead<'a> {
445
445
// than a naive loop. It runs faster than equivalent two-pass memchr2+SWAR code on
446
446
// benchmarks and it's cross-platform, so probably the right fit.
447
447
// [1]: https://groups.google.com/forum/#!original/comp.lang.c/2HtQXvg7iKc/xOJeipH6KLMJ
448
+
449
+ // The following architectures have native support for 64-bit integers,
450
+ // but have targets where usize is not 64-bit.
451
+ #[ cfg( any(
452
+ target_arch = "aarch64" ,
453
+ target_arch = "x86_64" ,
454
+ target_arch = "wasm32" ,
455
+ ) ) ]
456
+ type Chunk = u64 ;
457
+ #[ cfg( not( any(
458
+ target_arch = "aarch64" ,
459
+ target_arch = "x86_64" ,
460
+ target_arch = "wasm32" ,
461
+ ) ) ) ]
448
462
type Chunk = usize ;
463
+
449
464
const STEP : usize = mem:: size_of :: < Chunk > ( ) ;
450
465
const ONE_BYTES : Chunk = Chunk :: MAX / 255 ; // 0x0101...01
451
466
You can’t perform that action at this time.
0 commit comments