File tree Expand file tree Collapse file tree 1 file changed +8
-4
lines changed
src/ICSharpCode.SharpZipLib/BZip2 Expand file tree Collapse file tree 1 file changed +8
-4
lines changed Original file line number Diff line number Diff line change 1+ #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER
2+ #define VECTORIZE_MEMORY_MOVE
3+ #endif
4+
15using ICSharpCode . SharpZipLib . Checksum ;
26using System ;
37using System . IO ;
@@ -19,9 +23,9 @@ public class BZip2InputStream : Stream
1923 private const int NO_RAND_PART_B_STATE = 6 ;
2024 private const int NO_RAND_PART_C_STATE = 7 ;
2125
22- #if NETSTANDARD2_1
26+ #if VECTORIZE_MEMORY_MOVE
2327 private static readonly int VectorSize = System . Numerics . Vector < byte > . Count ;
24- #endif
28+ #endif // VECTORIZE_MEMORY_MOVE
2529
2630#endregion Constants
2731
@@ -717,7 +721,7 @@ cache misses.
717721
718722 var j = nextSym - 1 ;
719723
720- #if ! NETSTANDARD2_0 && ! NETFRAMEWORK
724+ #if VECTORIZE_MEMORY_MOVE
721725 // This is vectorized memory move. Going from the back, we're taking chunks of array
722726 // and write them at the new location shifted by one. Since chunks are VectorSize long,
723727 // at the end we have to move "tail" (or head actually) of the array using a plain loop.
@@ -729,7 +733,7 @@ cache misses.
729733 arrayPart . CopyTo ( yy , j - VectorSize + 1 ) ;
730734 j -= VectorSize ;
731735 }
732- #endif
736+ #endif // VECTORIZE_MEMORY_MOVE
733737
734738 while ( j > 0 )
735739 {
You can’t perform that action at this time.
0 commit comments