@@ -335,7 +335,8 @@ type ParseStrFn = for<'invoke, 'de> unsafe fn(
335335 any( target_arch = "x86_64" , target_arch = "x86" ) ,
336336) ) ]
337337type FindStructuralBitsFn = unsafe fn (
338- input : & [ u8 ] ,
338+ input : & AlignedBuf ,
339+ len : usize ,
339340 structural_indexes : & mut Vec < u32 > ,
340341) -> std:: result:: Result < ( ) , ErrorType > ;
341342
@@ -611,7 +612,8 @@ impl Deserializer<'_> {
611612 any( target_arch = "x86_64" , target_arch = "x86" ) ,
612613 ) ) ]
613614 pub ( crate ) unsafe fn find_structural_bits (
614- input : & [ u8 ] ,
615+ input : & AlignedBuf ,
616+ len : usize ,
615617 structural_indexes : & mut Vec < u32 > ,
616618 ) -> std:: result:: Result < ( ) , ErrorType > {
617619 unsafe {
@@ -636,18 +638,19 @@ impl Deserializer<'_> {
636638
637639 #[ cfg_attr( not( feature = "no-inline" ) , inline) ]
638640 unsafe fn get_fastest (
639- input : & [ u8 ] ,
641+ input : & AlignedBuf ,
642+ len : usize ,
640643 structural_indexes : & mut Vec < u32 > ,
641644 ) -> core:: result:: Result < ( ) , error:: ErrorType > {
642645 unsafe {
643646 let fun = get_fastest_available_implementation ( ) ;
644647 FN . store ( fun as FnRaw , Ordering :: Relaxed ) ;
645- ( fun) ( input, structural_indexes)
648+ ( fun) ( input, len , structural_indexes)
646649 }
647650 }
648651
649652 let fun = FN . load ( Ordering :: Relaxed ) ;
650- mem:: transmute :: < FnRaw , FindStructuralBitsFn > ( fun) ( input, structural_indexes)
653+ mem:: transmute :: < FnRaw , FindStructuralBitsFn > ( fun) ( input, len , structural_indexes)
651654 }
652655 }
653656
@@ -664,7 +667,7 @@ impl Deserializer<'_> {
664667 ) ) ) ]
665668 #[ cfg_attr( not( feature = "no-inline" ) , inline) ]
666669 pub ( crate ) unsafe fn find_structural_bits (
667- input : & [ u8 ] ,
670+ input : & AlignedBuf ,
668671 len : usize ,
669672 structural_indexes : & mut Vec < u32 > ,
670673 ) -> std:: result:: Result < ( ) , ErrorType > {
@@ -683,7 +686,7 @@ impl Deserializer<'_> {
683686 #[ cfg( all( feature = "portable" , not( feature = "runtime-detection" ) ) ) ]
684687 #[ cfg_attr( not( feature = "no-inline" ) , inline) ]
685688 pub ( crate ) unsafe fn find_structural_bits (
686- input : & [ u8 ] ,
689+ input : & AlignedBuf ,
687690 len : usize ,
688691 structural_indexes : & mut Vec < u32 > ,
689692 ) -> std:: result:: Result < ( ) , ErrorType > {
@@ -703,7 +706,7 @@ impl Deserializer<'_> {
703706 ) ) ]
704707 #[ cfg_attr( not( feature = "no-inline" ) , inline) ]
705708 pub ( crate ) unsafe fn find_structural_bits (
706- input : & [ u8 ] ,
709+ input : & AlignedBuf ,
707710 len : usize ,
708711 structural_indexes : & mut Vec < u32 > ,
709712 ) -> std:: result:: Result < ( ) , ErrorType > {
@@ -720,7 +723,7 @@ impl Deserializer<'_> {
720723 ) ) ]
721724 #[ cfg_attr( not( feature = "no-inline" ) , inline) ]
722725 pub ( crate ) unsafe fn find_structural_bits (
723- input : & [ u8 ] ,
726+ input : & AlignedBuf ,
724727 len : usize ,
725728 structural_indexes : & mut Vec < u32 > ,
726729 ) -> std:: result:: Result < ( ) , ErrorType > {
@@ -744,7 +747,7 @@ impl Deserializer<'_> {
744747 #[ cfg( all( target_feature = "simd128" , not( feature = "portable" ) ) ) ]
745748 #[ cfg_attr( not( feature = "no-inline" ) , inline) ]
746749 pub ( crate ) unsafe fn find_structural_bits (
747- input : & [ u8 ] ,
750+ input : & AlignedBuf ,
748751 len : usize ,
749752 structural_indexes : & mut Vec < u32 > ,
750753 ) -> std:: result:: Result < ( ) , ErrorType > {
0 commit comments