electrobun 0.0.1 → 0.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (667) hide show
  1. package/.gitmodules +3 -0
  2. package/dist/webview +0 -0
  3. package/package.json +1 -1
  4. package/src/cli/build/electrobun +0 -0
  5. package/example/assets/electrobun-logo-32-template.png +0 -0
  6. package/example/buildScript.ts +0 -1
  7. package/example/bun.lockb +0 -0
  8. package/example/electrobun.config +0 -48
  9. package/example/icon.iconset/icon_128x128.png +0 -0
  10. package/example/icon.iconset/icon_128x128@2x.png +0 -0
  11. package/example/icon.iconset/icon_16x16.png +0 -0
  12. package/example/icon.iconset/icon_16x16@2x.png +0 -0
  13. package/example/icon.iconset/icon_256x256.png +0 -0
  14. package/example/icon.iconset/icon_256x256@2x.png +0 -0
  15. package/example/icon.iconset/icon_32x32.png +0 -0
  16. package/example/icon.iconset/icon_32x32@2x.png +0 -0
  17. package/example/icon.iconset/icon_512x512.png +0 -0
  18. package/example/icon.iconset/icon_512x512@2x.png +0 -0
  19. package/example/package-lock.json +0 -32
  20. package/example/package.json +0 -11
  21. package/example/readme.md +0 -0
  22. package/example/src/bun/index.ts +0 -403
  23. package/example/src/mainview/index.css +0 -4
  24. package/example/src/mainview/index.html +0 -13
  25. package/example/src/mainview/index.ts +0 -45
  26. package/example/src/mainview/rpc.ts +0 -36
  27. package/example/src/myextension/preload.ts +0 -15
  28. package/example/src/myextension/rpc.ts +0 -15
  29. package/example/src/webviewtag/electrobun.png +0 -0
  30. package/example/src/webviewtag/index.html +0 -94
  31. package/example/src/webviewtag/index.ts +0 -26
  32. package/src/bsdiff/bsdiff.zig +0 -842
  33. package/src/bsdiff/bspatch.zig +0 -253
  34. package/src/bsdiff/build.zig +0 -73
  35. package/src/bsdiff/zig-out/bin/bsdiff +0 -0
  36. package/src/bsdiff/zig-out/bin/bspatch +0 -0
  37. package/src/bsdiff/zig-out/lib/libzstd.a +0 -0
  38. package/src/bsdiff/zstd/.buckconfig +0 -9
  39. package/src/bsdiff/zstd/.buckversion +0 -1
  40. package/src/bsdiff/zstd/.circleci/config.yml +0 -123
  41. package/src/bsdiff/zstd/.circleci/images/primary/Dockerfile +0 -9
  42. package/src/bsdiff/zstd/.cirrus.yml +0 -10
  43. package/src/bsdiff/zstd/.gitattributes +0 -21
  44. package/src/bsdiff/zstd/.github/ISSUE_TEMPLATE/bug_report.md +0 -35
  45. package/src/bsdiff/zstd/.github/ISSUE_TEMPLATE/feature_request.md +0 -20
  46. package/src/bsdiff/zstd/.github/dependabot.yml +0 -6
  47. package/src/bsdiff/zstd/.github/workflows/commit.yml +0 -89
  48. package/src/bsdiff/zstd/.github/workflows/dev-long-tests.yml +0 -297
  49. package/src/bsdiff/zstd/.github/workflows/dev-short-tests.yml +0 -633
  50. package/src/bsdiff/zstd/.github/workflows/nightly.yml +0 -65
  51. package/src/bsdiff/zstd/.github/workflows/publish-release-artifacts.yml +0 -73
  52. package/src/bsdiff/zstd/.github/workflows/scorecards.yml +0 -64
  53. package/src/bsdiff/zstd/.github/workflows/windows-artifacts.yml +0 -58
  54. package/src/bsdiff/zstd/CHANGELOG +0 -837
  55. package/src/bsdiff/zstd/CODE_OF_CONDUCT.md +0 -5
  56. package/src/bsdiff/zstd/CONTRIBUTING.md +0 -489
  57. package/src/bsdiff/zstd/COPYING +0 -339
  58. package/src/bsdiff/zstd/LICENSE +0 -30
  59. package/src/bsdiff/zstd/Makefile +0 -457
  60. package/src/bsdiff/zstd/Package.swift +0 -36
  61. package/src/bsdiff/zstd/README.md +0 -227
  62. package/src/bsdiff/zstd/SECURITY.md +0 -15
  63. package/src/bsdiff/zstd/TESTING.md +0 -43
  64. package/src/bsdiff/zstd/build/LICENSE +0 -0
  65. package/src/bsdiff/zstd/build/README.md +0 -56
  66. package/src/bsdiff/zstd/build/VS2008/fullbench/fullbench.vcproj +0 -549
  67. package/src/bsdiff/zstd/build/VS2008/fuzzer/fuzzer.vcproj +0 -585
  68. package/src/bsdiff/zstd/build/VS2008/zstd/zstd.vcproj +0 -677
  69. package/src/bsdiff/zstd/build/VS2008/zstd.sln +0 -56
  70. package/src/bsdiff/zstd/build/VS2008/zstdlib/zstdlib.vcproj +0 -635
  71. package/src/bsdiff/zstd/build/VS2010/CompileAsCpp.props +0 -8
  72. package/src/bsdiff/zstd/build/VS2010/datagen/datagen.vcxproj +0 -170
  73. package/src/bsdiff/zstd/build/VS2010/fullbench/fullbench.vcxproj +0 -218
  74. package/src/bsdiff/zstd/build/VS2010/fullbench-dll/fullbench-dll.vcxproj +0 -189
  75. package/src/bsdiff/zstd/build/VS2010/fuzzer/fuzzer.vcxproj +0 -223
  76. package/src/bsdiff/zstd/build/VS2010/libzstd/libzstd.vcxproj +0 -242
  77. package/src/bsdiff/zstd/build/VS2010/libzstd-dll/libzstd-dll.rc +0 -51
  78. package/src/bsdiff/zstd/build/VS2010/libzstd-dll/libzstd-dll.vcxproj +0 -249
  79. package/src/bsdiff/zstd/build/VS2010/zstd/zstd.rc +0 -51
  80. package/src/bsdiff/zstd/build/VS2010/zstd/zstd.vcxproj +0 -265
  81. package/src/bsdiff/zstd/build/VS2010/zstd.sln +0 -89
  82. package/src/bsdiff/zstd/build/VS_scripts/README.md +0 -64
  83. package/src/bsdiff/zstd/build/VS_scripts/build.VS2010.cmd +0 -7
  84. package/src/bsdiff/zstd/build/VS_scripts/build.VS2012.cmd +0 -6
  85. package/src/bsdiff/zstd/build/VS_scripts/build.VS2013.cmd +0 -7
  86. package/src/bsdiff/zstd/build/VS_scripts/build.VS2015.cmd +0 -7
  87. package/src/bsdiff/zstd/build/VS_scripts/build.VS2017.cmd +0 -7
  88. package/src/bsdiff/zstd/build/VS_scripts/build.VS2017Community.cmd +0 -7
  89. package/src/bsdiff/zstd/build/VS_scripts/build.VS2017Enterprise.cmd +0 -7
  90. package/src/bsdiff/zstd/build/VS_scripts/build.VS2017Professional.cmd +0 -7
  91. package/src/bsdiff/zstd/build/VS_scripts/build.generic.cmd +0 -72
  92. package/src/bsdiff/zstd/build/cmake/CMakeLists.txt +0 -216
  93. package/src/bsdiff/zstd/build/cmake/CMakeModules/AddZstdCompilationFlags.cmake +0 -121
  94. package/src/bsdiff/zstd/build/cmake/CMakeModules/FindLibLZ4.cmake +0 -49
  95. package/src/bsdiff/zstd/build/cmake/CMakeModules/GetZstdLibraryVersion.cmake +0 -10
  96. package/src/bsdiff/zstd/build/cmake/CMakeModules/JoinPaths.cmake +0 -23
  97. package/src/bsdiff/zstd/build/cmake/README.md +0 -136
  98. package/src/bsdiff/zstd/build/cmake/contrib/CMakeLists.txt +0 -13
  99. package/src/bsdiff/zstd/build/cmake/contrib/gen_html/CMakeLists.txt +0 -30
  100. package/src/bsdiff/zstd/build/cmake/contrib/pzstd/CMakeLists.txt +0 -39
  101. package/src/bsdiff/zstd/build/cmake/lib/CMakeLists.txt +0 -253
  102. package/src/bsdiff/zstd/build/cmake/lib/cmake_uninstall.cmake.in +0 -22
  103. package/src/bsdiff/zstd/build/cmake/programs/CMakeLists.txt +0 -144
  104. package/src/bsdiff/zstd/build/cmake/tests/CMakeLists.txt +0 -118
  105. package/src/bsdiff/zstd/build/cmake/zstdConfig.cmake.in +0 -10
  106. package/src/bsdiff/zstd/build/meson/GetZstdLibraryVersion.py +0 -39
  107. package/src/bsdiff/zstd/build/meson/InstallSymlink.py +0 -55
  108. package/src/bsdiff/zstd/build/meson/README.md +0 -38
  109. package/src/bsdiff/zstd/build/meson/contrib/gen_html/meson.build +0 -30
  110. package/src/bsdiff/zstd/build/meson/contrib/meson.build +0 -12
  111. package/src/bsdiff/zstd/build/meson/contrib/pzstd/meson.build +0 -25
  112. package/src/bsdiff/zstd/build/meson/lib/meson.build +0 -167
  113. package/src/bsdiff/zstd/build/meson/meson.build +0 -145
  114. package/src/bsdiff/zstd/build/meson/meson_options.txt +0 -36
  115. package/src/bsdiff/zstd/build/meson/programs/meson.build +0 -124
  116. package/src/bsdiff/zstd/build/meson/tests/meson.build +0 -217
  117. package/src/bsdiff/zstd/build/meson/tests/valgrindTest.py +0 -90
  118. package/src/bsdiff/zstd/build/single_file_libs/README.md +0 -33
  119. package/src/bsdiff/zstd/build/single_file_libs/build_decoder_test.sh +0 -91
  120. package/src/bsdiff/zstd/build/single_file_libs/build_library_test.sh +0 -97
  121. package/src/bsdiff/zstd/build/single_file_libs/combine.py +0 -234
  122. package/src/bsdiff/zstd/build/single_file_libs/combine.sh +0 -249
  123. package/src/bsdiff/zstd/build/single_file_libs/create_single_file_decoder.sh +0 -19
  124. package/src/bsdiff/zstd/build/single_file_libs/create_single_file_library.sh +0 -19
  125. package/src/bsdiff/zstd/build/single_file_libs/examples/README.md +0 -11
  126. package/src/bsdiff/zstd/build/single_file_libs/examples/emscripten.c +0 -340
  127. package/src/bsdiff/zstd/build/single_file_libs/examples/roundtrip.c +0 -83
  128. package/src/bsdiff/zstd/build/single_file_libs/examples/shell.html +0 -31
  129. package/src/bsdiff/zstd/build/single_file_libs/examples/simple.c +0 -75
  130. package/src/bsdiff/zstd/build/single_file_libs/examples/testcard-dxt1.inl +0 -2731
  131. package/src/bsdiff/zstd/build/single_file_libs/examples/testcard-zstd.inl +0 -261
  132. package/src/bsdiff/zstd/build/single_file_libs/examples/testcard.png +0 -0
  133. package/src/bsdiff/zstd/build/single_file_libs/zstd-in.c +0 -90
  134. package/src/bsdiff/zstd/build/single_file_libs/zstddeclib-in.c +0 -62
  135. package/src/bsdiff/zstd/contrib/VS2005/README.md +0 -3
  136. package/src/bsdiff/zstd/contrib/VS2005/fullbench/fullbench.vcproj +0 -440
  137. package/src/bsdiff/zstd/contrib/VS2005/fuzzer/fuzzer.vcproj +0 -488
  138. package/src/bsdiff/zstd/contrib/VS2005/zstd/zstd.vcproj +0 -552
  139. package/src/bsdiff/zstd/contrib/VS2005/zstd.sln +0 -55
  140. package/src/bsdiff/zstd/contrib/VS2005/zstdlib/zstdlib.vcproj +0 -546
  141. package/src/bsdiff/zstd/contrib/cleanTabs +0 -2
  142. package/src/bsdiff/zstd/contrib/diagnose_corruption/Makefile +0 -35
  143. package/src/bsdiff/zstd/contrib/diagnose_corruption/check_flipped_bits.c +0 -400
  144. package/src/bsdiff/zstd/contrib/docker/Dockerfile +0 -20
  145. package/src/bsdiff/zstd/contrib/docker/README.md +0 -20
  146. package/src/bsdiff/zstd/contrib/externalSequenceProducer/Makefile +0 -40
  147. package/src/bsdiff/zstd/contrib/externalSequenceProducer/README.md +0 -14
  148. package/src/bsdiff/zstd/contrib/externalSequenceProducer/main.c +0 -107
  149. package/src/bsdiff/zstd/contrib/externalSequenceProducer/sequence_producer.c +0 -80
  150. package/src/bsdiff/zstd/contrib/externalSequenceProducer/sequence_producer.h +0 -26
  151. package/src/bsdiff/zstd/contrib/freestanding_lib/freestanding.py +0 -774
  152. package/src/bsdiff/zstd/contrib/gen_html/Makefile +0 -51
  153. package/src/bsdiff/zstd/contrib/gen_html/README.md +0 -31
  154. package/src/bsdiff/zstd/contrib/gen_html/gen-zstd-manual.sh +0 -9
  155. package/src/bsdiff/zstd/contrib/gen_html/gen_html.cpp +0 -224
  156. package/src/bsdiff/zstd/contrib/largeNbDicts/Makefile +0 -58
  157. package/src/bsdiff/zstd/contrib/largeNbDicts/README.md +0 -33
  158. package/src/bsdiff/zstd/contrib/largeNbDicts/largeNbDicts.c +0 -1085
  159. package/src/bsdiff/zstd/contrib/linux-kernel/Makefile +0 -108
  160. package/src/bsdiff/zstd/contrib/linux-kernel/README.md +0 -14
  161. package/src/bsdiff/zstd/contrib/linux-kernel/btrfs-benchmark.sh +0 -104
  162. package/src/bsdiff/zstd/contrib/linux-kernel/btrfs-extract-benchmark.sh +0 -99
  163. package/src/bsdiff/zstd/contrib/linux-kernel/decompress_sources.h +0 -34
  164. package/src/bsdiff/zstd/contrib/linux-kernel/linux.mk +0 -43
  165. package/src/bsdiff/zstd/contrib/linux-kernel/linux_zstd.h +0 -447
  166. package/src/bsdiff/zstd/contrib/linux-kernel/mem.h +0 -262
  167. package/src/bsdiff/zstd/contrib/linux-kernel/squashfs-benchmark.sh +0 -39
  168. package/src/bsdiff/zstd/contrib/linux-kernel/test/Makefile +0 -49
  169. package/src/bsdiff/zstd/contrib/linux-kernel/test/include/asm/unaligned.h +0 -187
  170. package/src/bsdiff/zstd/contrib/linux-kernel/test/include/linux/compiler.h +0 -23
  171. package/src/bsdiff/zstd/contrib/linux-kernel/test/include/linux/errno.h +0 -15
  172. package/src/bsdiff/zstd/contrib/linux-kernel/test/include/linux/kernel.h +0 -19
  173. package/src/bsdiff/zstd/contrib/linux-kernel/test/include/linux/limits.h +0 -15
  174. package/src/bsdiff/zstd/contrib/linux-kernel/test/include/linux/math64.h +0 -15
  175. package/src/bsdiff/zstd/contrib/linux-kernel/test/include/linux/module.h +0 -20
  176. package/src/bsdiff/zstd/contrib/linux-kernel/test/include/linux/printk.h +0 -15
  177. package/src/bsdiff/zstd/contrib/linux-kernel/test/include/linux/stddef.h +0 -15
  178. package/src/bsdiff/zstd/contrib/linux-kernel/test/include/linux/swab.h +0 -16
  179. package/src/bsdiff/zstd/contrib/linux-kernel/test/include/linux/types.h +0 -16
  180. package/src/bsdiff/zstd/contrib/linux-kernel/test/include/linux/xxhash.h +0 -745
  181. package/src/bsdiff/zstd/contrib/linux-kernel/test/macro-test.sh +0 -44
  182. package/src/bsdiff/zstd/contrib/linux-kernel/test/static_test.c +0 -52
  183. package/src/bsdiff/zstd/contrib/linux-kernel/test/test.c +0 -229
  184. package/src/bsdiff/zstd/contrib/linux-kernel/zstd_common_module.c +0 -29
  185. package/src/bsdiff/zstd/contrib/linux-kernel/zstd_compress_module.c +0 -164
  186. package/src/bsdiff/zstd/contrib/linux-kernel/zstd_decompress_module.c +0 -105
  187. package/src/bsdiff/zstd/contrib/linux-kernel/zstd_deps.h +0 -121
  188. package/src/bsdiff/zstd/contrib/match_finders/README.md +0 -42
  189. package/src/bsdiff/zstd/contrib/match_finders/zstd_edist.c +0 -558
  190. package/src/bsdiff/zstd/contrib/match_finders/zstd_edist.h +0 -70
  191. package/src/bsdiff/zstd/contrib/premake/premake4.lua +0 -6
  192. package/src/bsdiff/zstd/contrib/premake/zstd.lua +0 -80
  193. package/src/bsdiff/zstd/contrib/pzstd/BUCK +0 -72
  194. package/src/bsdiff/zstd/contrib/pzstd/ErrorHolder.h +0 -54
  195. package/src/bsdiff/zstd/contrib/pzstd/Logging.h +0 -72
  196. package/src/bsdiff/zstd/contrib/pzstd/Makefile +0 -265
  197. package/src/bsdiff/zstd/contrib/pzstd/Options.cpp +0 -424
  198. package/src/bsdiff/zstd/contrib/pzstd/Options.h +0 -71
  199. package/src/bsdiff/zstd/contrib/pzstd/Pzstd.cpp +0 -618
  200. package/src/bsdiff/zstd/contrib/pzstd/Pzstd.h +0 -153
  201. package/src/bsdiff/zstd/contrib/pzstd/README.md +0 -56
  202. package/src/bsdiff/zstd/contrib/pzstd/SkippableFrame.cpp +0 -30
  203. package/src/bsdiff/zstd/contrib/pzstd/SkippableFrame.h +0 -64
  204. package/src/bsdiff/zstd/contrib/pzstd/images/Cspeed.png +0 -0
  205. package/src/bsdiff/zstd/contrib/pzstd/images/Dspeed.png +0 -0
  206. package/src/bsdiff/zstd/contrib/pzstd/main.cpp +0 -27
  207. package/src/bsdiff/zstd/contrib/pzstd/test/BUCK +0 -37
  208. package/src/bsdiff/zstd/contrib/pzstd/test/OptionsTest.cpp +0 -536
  209. package/src/bsdiff/zstd/contrib/pzstd/test/PzstdTest.cpp +0 -149
  210. package/src/bsdiff/zstd/contrib/pzstd/test/RoundTrip.h +0 -86
  211. package/src/bsdiff/zstd/contrib/pzstd/test/RoundTripTest.cpp +0 -86
  212. package/src/bsdiff/zstd/contrib/pzstd/utils/BUCK +0 -75
  213. package/src/bsdiff/zstd/contrib/pzstd/utils/Buffer.h +0 -99
  214. package/src/bsdiff/zstd/contrib/pzstd/utils/FileSystem.h +0 -96
  215. package/src/bsdiff/zstd/contrib/pzstd/utils/Likely.h +0 -28
  216. package/src/bsdiff/zstd/contrib/pzstd/utils/Portability.h +0 -16
  217. package/src/bsdiff/zstd/contrib/pzstd/utils/Range.h +0 -133
  218. package/src/bsdiff/zstd/contrib/pzstd/utils/ResourcePool.h +0 -96
  219. package/src/bsdiff/zstd/contrib/pzstd/utils/ScopeGuard.h +0 -50
  220. package/src/bsdiff/zstd/contrib/pzstd/utils/ThreadPool.h +0 -58
  221. package/src/bsdiff/zstd/contrib/pzstd/utils/WorkQueue.h +0 -181
  222. package/src/bsdiff/zstd/contrib/pzstd/utils/test/BUCK +0 -35
  223. package/src/bsdiff/zstd/contrib/pzstd/utils/test/BufferTest.cpp +0 -89
  224. package/src/bsdiff/zstd/contrib/pzstd/utils/test/RangeTest.cpp +0 -82
  225. package/src/bsdiff/zstd/contrib/pzstd/utils/test/ResourcePoolTest.cpp +0 -72
  226. package/src/bsdiff/zstd/contrib/pzstd/utils/test/ScopeGuardTest.cpp +0 -28
  227. package/src/bsdiff/zstd/contrib/pzstd/utils/test/ThreadPoolTest.cpp +0 -71
  228. package/src/bsdiff/zstd/contrib/pzstd/utils/test/WorkQueueTest.cpp +0 -282
  229. package/src/bsdiff/zstd/contrib/recovery/Makefile +0 -35
  230. package/src/bsdiff/zstd/contrib/recovery/recover_directory.c +0 -152
  231. package/src/bsdiff/zstd/contrib/seekable_format/README.md +0 -42
  232. package/src/bsdiff/zstd/contrib/seekable_format/examples/Makefile +0 -53
  233. package/src/bsdiff/zstd/contrib/seekable_format/examples/parallel_compression.c +0 -214
  234. package/src/bsdiff/zstd/contrib/seekable_format/examples/parallel_processing.c +0 -194
  235. package/src/bsdiff/zstd/contrib/seekable_format/examples/seekable_compression.c +0 -136
  236. package/src/bsdiff/zstd/contrib/seekable_format/examples/seekable_decompression.c +0 -141
  237. package/src/bsdiff/zstd/contrib/seekable_format/examples/seekable_decompression_mem.c +0 -147
  238. package/src/bsdiff/zstd/contrib/seekable_format/tests/Makefile +0 -38
  239. package/src/bsdiff/zstd/contrib/seekable_format/tests/seekable_tests.c +0 -363
  240. package/src/bsdiff/zstd/contrib/seekable_format/zstd_seekable.h +0 -226
  241. package/src/bsdiff/zstd/contrib/seekable_format/zstd_seekable_compression_format.md +0 -116
  242. package/src/bsdiff/zstd/contrib/seekable_format/zstdseek_compress.c +0 -365
  243. package/src/bsdiff/zstd/contrib/seekable_format/zstdseek_decompress.c +0 -595
  244. package/src/bsdiff/zstd/contrib/seqBench/Makefile +0 -58
  245. package/src/bsdiff/zstd/contrib/seqBench/seqBench.c +0 -53
  246. package/src/bsdiff/zstd/contrib/snap/snapcraft.yaml +0 -28
  247. package/src/bsdiff/zstd/doc/README.md +0 -26
  248. package/src/bsdiff/zstd/doc/decompressor_errata.md +0 -148
  249. package/src/bsdiff/zstd/doc/decompressor_permissive.md +0 -60
  250. package/src/bsdiff/zstd/doc/educational_decoder/Makefile +0 -62
  251. package/src/bsdiff/zstd/doc/educational_decoder/README.md +0 -36
  252. package/src/bsdiff/zstd/doc/educational_decoder/harness.c +0 -119
  253. package/src/bsdiff/zstd/doc/educational_decoder/zstd_decompress.c +0 -2323
  254. package/src/bsdiff/zstd/doc/educational_decoder/zstd_decompress.h +0 -61
  255. package/src/bsdiff/zstd/doc/images/CSpeed2.png +0 -0
  256. package/src/bsdiff/zstd/doc/images/DCspeed5.png +0 -0
  257. package/src/bsdiff/zstd/doc/images/DSpeed3.png +0 -0
  258. package/src/bsdiff/zstd/doc/images/cdict_v136.png +0 -0
  259. package/src/bsdiff/zstd/doc/images/dict-cr.png +0 -0
  260. package/src/bsdiff/zstd/doc/images/dict-cs.png +0 -0
  261. package/src/bsdiff/zstd/doc/images/dict-ds.png +0 -0
  262. package/src/bsdiff/zstd/doc/images/zstd_cdict_v1_3_5.png +0 -0
  263. package/src/bsdiff/zstd/doc/images/zstd_logo86.png +0 -0
  264. package/src/bsdiff/zstd/doc/zstd_compression_format.md +0 -1737
  265. package/src/bsdiff/zstd/doc/zstd_manual.html +0 -2170
  266. package/src/bsdiff/zstd/examples/Makefile +0 -93
  267. package/src/bsdiff/zstd/examples/README.md +0 -46
  268. package/src/bsdiff/zstd/examples/common.h +0 -246
  269. package/src/bsdiff/zstd/examples/dictionary_compression.c +0 -107
  270. package/src/bsdiff/zstd/examples/dictionary_decompression.c +0 -99
  271. package/src/bsdiff/zstd/examples/multiple_simple_compression.c +0 -116
  272. package/src/bsdiff/zstd/examples/multiple_streaming_compression.c +0 -133
  273. package/src/bsdiff/zstd/examples/simple_compression.c +0 -68
  274. package/src/bsdiff/zstd/examples/simple_decompression.c +0 -65
  275. package/src/bsdiff/zstd/examples/streaming_compression.c +0 -146
  276. package/src/bsdiff/zstd/examples/streaming_compression_thread_pool.c +0 -180
  277. package/src/bsdiff/zstd/examples/streaming_decompression.c +0 -100
  278. package/src/bsdiff/zstd/examples/streaming_memory_usage.c +0 -137
  279. package/src/bsdiff/zstd/lib/BUCK +0 -232
  280. package/src/bsdiff/zstd/lib/Makefile +0 -369
  281. package/src/bsdiff/zstd/lib/README.md +0 -237
  282. package/src/bsdiff/zstd/lib/common/allocations.h +0 -55
  283. package/src/bsdiff/zstd/lib/common/bits.h +0 -200
  284. package/src/bsdiff/zstd/lib/common/bitstream.h +0 -457
  285. package/src/bsdiff/zstd/lib/common/compiler.h +0 -450
  286. package/src/bsdiff/zstd/lib/common/cpu.h +0 -249
  287. package/src/bsdiff/zstd/lib/common/debug.c +0 -30
  288. package/src/bsdiff/zstd/lib/common/debug.h +0 -116
  289. package/src/bsdiff/zstd/lib/common/entropy_common.c +0 -340
  290. package/src/bsdiff/zstd/lib/common/error_private.c +0 -63
  291. package/src/bsdiff/zstd/lib/common/error_private.h +0 -168
  292. package/src/bsdiff/zstd/lib/common/fse.h +0 -640
  293. package/src/bsdiff/zstd/lib/common/fse_decompress.c +0 -313
  294. package/src/bsdiff/zstd/lib/common/huf.h +0 -286
  295. package/src/bsdiff/zstd/lib/common/mem.h +0 -426
  296. package/src/bsdiff/zstd/lib/common/pool.c +0 -371
  297. package/src/bsdiff/zstd/lib/common/pool.h +0 -90
  298. package/src/bsdiff/zstd/lib/common/portability_macros.h +0 -158
  299. package/src/bsdiff/zstd/lib/common/threading.c +0 -182
  300. package/src/bsdiff/zstd/lib/common/threading.h +0 -150
  301. package/src/bsdiff/zstd/lib/common/xxhash.c +0 -18
  302. package/src/bsdiff/zstd/lib/common/xxhash.h +0 -7020
  303. package/src/bsdiff/zstd/lib/common/zstd_common.c +0 -48
  304. package/src/bsdiff/zstd/lib/common/zstd_deps.h +0 -111
  305. package/src/bsdiff/zstd/lib/common/zstd_internal.h +0 -392
  306. package/src/bsdiff/zstd/lib/common/zstd_trace.h +0 -163
  307. package/src/bsdiff/zstd/lib/compress/clevels.h +0 -134
  308. package/src/bsdiff/zstd/lib/compress/fse_compress.c +0 -625
  309. package/src/bsdiff/zstd/lib/compress/hist.c +0 -181
  310. package/src/bsdiff/zstd/lib/compress/hist.h +0 -75
  311. package/src/bsdiff/zstd/lib/compress/huf_compress.c +0 -1464
  312. package/src/bsdiff/zstd/lib/compress/zstd_compress.c +0 -7153
  313. package/src/bsdiff/zstd/lib/compress/zstd_compress_internal.h +0 -1534
  314. package/src/bsdiff/zstd/lib/compress/zstd_compress_literals.c +0 -235
  315. package/src/bsdiff/zstd/lib/compress/zstd_compress_literals.h +0 -39
  316. package/src/bsdiff/zstd/lib/compress/zstd_compress_sequences.c +0 -442
  317. package/src/bsdiff/zstd/lib/compress/zstd_compress_sequences.h +0 -54
  318. package/src/bsdiff/zstd/lib/compress/zstd_compress_superblock.c +0 -688
  319. package/src/bsdiff/zstd/lib/compress/zstd_compress_superblock.h +0 -32
  320. package/src/bsdiff/zstd/lib/compress/zstd_cwksp.h +0 -748
  321. package/src/bsdiff/zstd/lib/compress/zstd_double_fast.c +0 -770
  322. package/src/bsdiff/zstd/lib/compress/zstd_double_fast.h +0 -50
  323. package/src/bsdiff/zstd/lib/compress/zstd_fast.c +0 -968
  324. package/src/bsdiff/zstd/lib/compress/zstd_fast.h +0 -38
  325. package/src/bsdiff/zstd/lib/compress/zstd_lazy.c +0 -2199
  326. package/src/bsdiff/zstd/lib/compress/zstd_lazy.h +0 -202
  327. package/src/bsdiff/zstd/lib/compress/zstd_ldm.c +0 -730
  328. package/src/bsdiff/zstd/lib/compress/zstd_ldm.h +0 -117
  329. package/src/bsdiff/zstd/lib/compress/zstd_ldm_geartab.h +0 -106
  330. package/src/bsdiff/zstd/lib/compress/zstd_opt.c +0 -1576
  331. package/src/bsdiff/zstd/lib/compress/zstd_opt.h +0 -80
  332. package/src/bsdiff/zstd/lib/compress/zstdmt_compress.c +0 -1882
  333. package/src/bsdiff/zstd/lib/compress/zstdmt_compress.h +0 -113
  334. package/src/bsdiff/zstd/lib/decompress/huf_decompress.c +0 -1944
  335. package/src/bsdiff/zstd/lib/decompress/huf_decompress_amd64.S +0 -595
  336. package/src/bsdiff/zstd/lib/decompress/zstd_ddict.c +0 -244
  337. package/src/bsdiff/zstd/lib/decompress/zstd_ddict.h +0 -44
  338. package/src/bsdiff/zstd/lib/decompress/zstd_decompress.c +0 -2407
  339. package/src/bsdiff/zstd/lib/decompress/zstd_decompress_block.c +0 -2215
  340. package/src/bsdiff/zstd/lib/decompress/zstd_decompress_block.h +0 -73
  341. package/src/bsdiff/zstd/lib/decompress/zstd_decompress_internal.h +0 -240
  342. package/src/bsdiff/zstd/lib/deprecated/zbuff.h +0 -214
  343. package/src/bsdiff/zstd/lib/deprecated/zbuff_common.c +0 -26
  344. package/src/bsdiff/zstd/lib/deprecated/zbuff_compress.c +0 -167
  345. package/src/bsdiff/zstd/lib/deprecated/zbuff_decompress.c +0 -77
  346. package/src/bsdiff/zstd/lib/dictBuilder/cover.c +0 -1261
  347. package/src/bsdiff/zstd/lib/dictBuilder/cover.h +0 -152
  348. package/src/bsdiff/zstd/lib/dictBuilder/divsufsort.c +0 -1913
  349. package/src/bsdiff/zstd/lib/dictBuilder/divsufsort.h +0 -67
  350. package/src/bsdiff/zstd/lib/dictBuilder/fastcover.c +0 -766
  351. package/src/bsdiff/zstd/lib/dictBuilder/zdict.c +0 -1133
  352. package/src/bsdiff/zstd/lib/dll/example/Makefile +0 -48
  353. package/src/bsdiff/zstd/lib/dll/example/README.md +0 -63
  354. package/src/bsdiff/zstd/lib/dll/example/build_package.bat +0 -20
  355. package/src/bsdiff/zstd/lib/dll/example/fullbench-dll.sln +0 -25
  356. package/src/bsdiff/zstd/lib/dll/example/fullbench-dll.vcxproj +0 -181
  357. package/src/bsdiff/zstd/lib/legacy/zstd_legacy.h +0 -452
  358. package/src/bsdiff/zstd/lib/legacy/zstd_v01.c +0 -2127
  359. package/src/bsdiff/zstd/lib/legacy/zstd_v01.h +0 -94
  360. package/src/bsdiff/zstd/lib/legacy/zstd_v02.c +0 -3465
  361. package/src/bsdiff/zstd/lib/legacy/zstd_v02.h +0 -93
  362. package/src/bsdiff/zstd/lib/legacy/zstd_v03.c +0 -3105
  363. package/src/bsdiff/zstd/lib/legacy/zstd_v03.h +0 -93
  364. package/src/bsdiff/zstd/lib/legacy/zstd_v04.c +0 -3598
  365. package/src/bsdiff/zstd/lib/legacy/zstd_v04.h +0 -142
  366. package/src/bsdiff/zstd/lib/legacy/zstd_v05.c +0 -4005
  367. package/src/bsdiff/zstd/lib/legacy/zstd_v05.h +0 -162
  368. package/src/bsdiff/zstd/lib/legacy/zstd_v06.c +0 -4106
  369. package/src/bsdiff/zstd/lib/legacy/zstd_v06.h +0 -172
  370. package/src/bsdiff/zstd/lib/legacy/zstd_v07.c +0 -4490
  371. package/src/bsdiff/zstd/lib/legacy/zstd_v07.h +0 -187
  372. package/src/bsdiff/zstd/lib/libzstd.mk +0 -237
  373. package/src/bsdiff/zstd/lib/libzstd.pc.in +0 -16
  374. package/src/bsdiff/zstd/lib/module.modulemap +0 -35
  375. package/src/bsdiff/zstd/lib/zdict.h +0 -474
  376. package/src/bsdiff/zstd/lib/zstd.h +0 -3089
  377. package/src/bsdiff/zstd/lib/zstd_errors.h +0 -114
  378. package/src/bsdiff/zstd/programs/BUCK +0 -44
  379. package/src/bsdiff/zstd/programs/Makefile +0 -445
  380. package/src/bsdiff/zstd/programs/README.md +0 -302
  381. package/src/bsdiff/zstd/programs/benchfn.c +0 -256
  382. package/src/bsdiff/zstd/programs/benchfn.h +0 -183
  383. package/src/bsdiff/zstd/programs/benchzstd.c +0 -1264
  384. package/src/bsdiff/zstd/programs/benchzstd.h +0 -198
  385. package/src/bsdiff/zstd/programs/datagen.c +0 -186
  386. package/src/bsdiff/zstd/programs/datagen.h +0 -30
  387. package/src/bsdiff/zstd/programs/dibio.c +0 -440
  388. package/src/bsdiff/zstd/programs/dibio.h +0 -39
  389. package/src/bsdiff/zstd/programs/fileio.c +0 -3470
  390. package/src/bsdiff/zstd/programs/fileio.h +0 -181
  391. package/src/bsdiff/zstd/programs/fileio_asyncio.c +0 -663
  392. package/src/bsdiff/zstd/programs/fileio_asyncio.h +0 -203
  393. package/src/bsdiff/zstd/programs/fileio_common.h +0 -125
  394. package/src/bsdiff/zstd/programs/fileio_types.h +0 -86
  395. package/src/bsdiff/zstd/programs/lorem.c +0 -285
  396. package/src/bsdiff/zstd/programs/lorem.h +0 -32
  397. package/src/bsdiff/zstd/programs/platform.h +0 -218
  398. package/src/bsdiff/zstd/programs/timefn.c +0 -168
  399. package/src/bsdiff/zstd/programs/timefn.h +0 -70
  400. package/src/bsdiff/zstd/programs/util.c +0 -1652
  401. package/src/bsdiff/zstd/programs/util.h +0 -359
  402. package/src/bsdiff/zstd/programs/windres/verrsrc.h +0 -17
  403. package/src/bsdiff/zstd/programs/windres/zstd.rc +0 -51
  404. package/src/bsdiff/zstd/programs/windres/zstd32.res +0 -0
  405. package/src/bsdiff/zstd/programs/windres/zstd64.res +0 -0
  406. package/src/bsdiff/zstd/programs/zstd.1 +0 -566
  407. package/src/bsdiff/zstd/programs/zstd.1.md +0 -695
  408. package/src/bsdiff/zstd/programs/zstdcli.c +0 -1625
  409. package/src/bsdiff/zstd/programs/zstdcli_trace.c +0 -172
  410. package/src/bsdiff/zstd/programs/zstdcli_trace.h +0 -24
  411. package/src/bsdiff/zstd/programs/zstdgrep +0 -134
  412. package/src/bsdiff/zstd/programs/zstdgrep.1 +0 -26
  413. package/src/bsdiff/zstd/programs/zstdgrep.1.md +0 -30
  414. package/src/bsdiff/zstd/programs/zstdless +0 -8
  415. package/src/bsdiff/zstd/programs/zstdless.1 +0 -14
  416. package/src/bsdiff/zstd/programs/zstdless.1.md +0 -16
  417. package/src/bsdiff/zstd/tests/DEPRECATED-test-zstd-speed.py +0 -378
  418. package/src/bsdiff/zstd/tests/Makefile +0 -477
  419. package/src/bsdiff/zstd/tests/README.md +0 -184
  420. package/src/bsdiff/zstd/tests/automated_benchmarking.py +0 -326
  421. package/src/bsdiff/zstd/tests/bigdict.c +0 -128
  422. package/src/bsdiff/zstd/tests/checkTag.c +0 -65
  423. package/src/bsdiff/zstd/tests/check_size.py +0 -31
  424. package/src/bsdiff/zstd/tests/cli-tests/README.md +0 -258
  425. package/src/bsdiff/zstd/tests/cli-tests/basic/args.sh +0 -10
  426. package/src/bsdiff/zstd/tests/cli-tests/basic/args.sh.exit +0 -1
  427. package/src/bsdiff/zstd/tests/cli-tests/basic/args.sh.stderr.glob +0 -28
  428. package/src/bsdiff/zstd/tests/cli-tests/basic/help.sh +0 -10
  429. package/src/bsdiff/zstd/tests/cli-tests/basic/help.sh.stdout.glob +0 -34
  430. package/src/bsdiff/zstd/tests/cli-tests/basic/memlimit.sh +0 -40
  431. package/src/bsdiff/zstd/tests/cli-tests/basic/memlimit.sh.stderr.exact +0 -13
  432. package/src/bsdiff/zstd/tests/cli-tests/basic/memlimit.sh.stdout.exact +0 -13
  433. package/src/bsdiff/zstd/tests/cli-tests/basic/output_dir.sh +0 -7
  434. package/src/bsdiff/zstd/tests/cli-tests/basic/output_dir.sh.stderr.exact +0 -2
  435. package/src/bsdiff/zstd/tests/cli-tests/basic/output_dir.sh.stdout.exact +0 -2
  436. package/src/bsdiff/zstd/tests/cli-tests/basic/version.sh +0 -6
  437. package/src/bsdiff/zstd/tests/cli-tests/basic/version.sh.stdout.glob +0 -2
  438. package/src/bsdiff/zstd/tests/cli-tests/bin/cmp_size +0 -44
  439. package/src/bsdiff/zstd/tests/cli-tests/bin/datagen +0 -3
  440. package/src/bsdiff/zstd/tests/cli-tests/bin/die +0 -4
  441. package/src/bsdiff/zstd/tests/cli-tests/bin/println +0 -2
  442. package/src/bsdiff/zstd/tests/cli-tests/bin/zstd +0 -9
  443. package/src/bsdiff/zstd/tests/cli-tests/bin/zstdgrep +0 -2
  444. package/src/bsdiff/zstd/tests/cli-tests/bin/zstdless +0 -2
  445. package/src/bsdiff/zstd/tests/cli-tests/cltools/setup +0 -6
  446. package/src/bsdiff/zstd/tests/cli-tests/cltools/zstdgrep.sh +0 -8
  447. package/src/bsdiff/zstd/tests/cli-tests/cltools/zstdgrep.sh.exit +0 -1
  448. package/src/bsdiff/zstd/tests/cli-tests/cltools/zstdgrep.sh.stderr.exact +0 -1
  449. package/src/bsdiff/zstd/tests/cli-tests/cltools/zstdgrep.sh.stdout.glob +0 -4
  450. package/src/bsdiff/zstd/tests/cli-tests/cltools/zstdless.sh +0 -10
  451. package/src/bsdiff/zstd/tests/cli-tests/cltools/zstdless.sh.stderr.exact +0 -2
  452. package/src/bsdiff/zstd/tests/cli-tests/cltools/zstdless.sh.stdout.glob +0 -5
  453. package/src/bsdiff/zstd/tests/cli-tests/common/format.sh +0 -19
  454. package/src/bsdiff/zstd/tests/cli-tests/common/mtime.sh +0 -13
  455. package/src/bsdiff/zstd/tests/cli-tests/common/permissions.sh +0 -18
  456. package/src/bsdiff/zstd/tests/cli-tests/common/platform.sh +0 -37
  457. package/src/bsdiff/zstd/tests/cli-tests/compression/adapt.sh +0 -14
  458. package/src/bsdiff/zstd/tests/cli-tests/compression/basic.sh +0 -36
  459. package/src/bsdiff/zstd/tests/cli-tests/compression/compress-literals.sh +0 -10
  460. package/src/bsdiff/zstd/tests/cli-tests/compression/format.sh +0 -16
  461. package/src/bsdiff/zstd/tests/cli-tests/compression/golden.sh +0 -16
  462. package/src/bsdiff/zstd/tests/cli-tests/compression/gzip-compat.sh +0 -17
  463. package/src/bsdiff/zstd/tests/cli-tests/compression/levels.sh +0 -62
  464. package/src/bsdiff/zstd/tests/cli-tests/compression/levels.sh.stderr.exact +0 -69
  465. package/src/bsdiff/zstd/tests/cli-tests/compression/long-distance-matcher.sh +0 -7
  466. package/src/bsdiff/zstd/tests/cli-tests/compression/multi-threaded.sh +0 -15
  467. package/src/bsdiff/zstd/tests/cli-tests/compression/multi-threaded.sh.stderr.exact +0 -11
  468. package/src/bsdiff/zstd/tests/cli-tests/compression/multiple-files.sh +0 -21
  469. package/src/bsdiff/zstd/tests/cli-tests/compression/multiple-files.sh.stdout.exact +0 -12
  470. package/src/bsdiff/zstd/tests/cli-tests/compression/row-match-finder.sh +0 -7
  471. package/src/bsdiff/zstd/tests/cli-tests/compression/setup +0 -7
  472. package/src/bsdiff/zstd/tests/cli-tests/compression/stream-size.sh +0 -7
  473. package/src/bsdiff/zstd/tests/cli-tests/compression/verbose-wlog.sh +0 -11
  474. package/src/bsdiff/zstd/tests/cli-tests/compression/verbose-wlog.sh.stderr.glob +0 -5
  475. package/src/bsdiff/zstd/tests/cli-tests/compression/verbose-wlog.sh.stdout.glob +0 -5
  476. package/src/bsdiff/zstd/tests/cli-tests/compression/window-resize.sh +0 -9
  477. package/src/bsdiff/zstd/tests/cli-tests/compression/window-resize.sh.stderr.ignore +0 -0
  478. package/src/bsdiff/zstd/tests/cli-tests/compression/window-resize.sh.stdout.glob +0 -3
  479. package/src/bsdiff/zstd/tests/cli-tests/decompression/detectErrors.sh +0 -11
  480. package/src/bsdiff/zstd/tests/cli-tests/decompression/golden.sh +0 -7
  481. package/src/bsdiff/zstd/tests/cli-tests/decompression/pass-through.sh +0 -57
  482. package/src/bsdiff/zstd/tests/cli-tests/decompression/pass-through.sh.stderr.exact +0 -11
  483. package/src/bsdiff/zstd/tests/cli-tests/decompression/pass-through.sh.stdout.exact +0 -25
  484. package/src/bsdiff/zstd/tests/cli-tests/dict-builder/empty-input.sh +0 -9
  485. package/src/bsdiff/zstd/tests/cli-tests/dict-builder/empty-input.sh.stderr.exact +0 -1
  486. package/src/bsdiff/zstd/tests/cli-tests/dict-builder/no-inputs.sh +0 -3
  487. package/src/bsdiff/zstd/tests/cli-tests/dict-builder/no-inputs.sh.exit +0 -1
  488. package/src/bsdiff/zstd/tests/cli-tests/dict-builder/no-inputs.sh.stderr.exact +0 -5
  489. package/src/bsdiff/zstd/tests/cli-tests/dictionaries/dictionary-mismatch.sh +0 -29
  490. package/src/bsdiff/zstd/tests/cli-tests/dictionaries/dictionary-mismatch.sh.stderr.exact +0 -7
  491. package/src/bsdiff/zstd/tests/cli-tests/dictionaries/golden.sh +0 -9
  492. package/src/bsdiff/zstd/tests/cli-tests/dictionaries/setup +0 -6
  493. package/src/bsdiff/zstd/tests/cli-tests/dictionaries/setup_once +0 -24
  494. package/src/bsdiff/zstd/tests/cli-tests/file-handling/directory-mirror.sh +0 -49
  495. package/src/bsdiff/zstd/tests/cli-tests/file-handling/directory-mirror.sh.stderr.exact +0 -0
  496. package/src/bsdiff/zstd/tests/cli-tests/file-handling/directory-mirror.sh.stdout.exact +0 -0
  497. package/src/bsdiff/zstd/tests/cli-tests/file-stat/compress-file-to-dir-without-write-perm.sh +0 -12
  498. package/src/bsdiff/zstd/tests/cli-tests/file-stat/compress-file-to-dir-without-write-perm.sh.stderr.exact +0 -26
  499. package/src/bsdiff/zstd/tests/cli-tests/file-stat/compress-file-to-file.sh +0 -9
  500. package/src/bsdiff/zstd/tests/cli-tests/file-stat/compress-file-to-file.sh.stderr.exact +0 -42
  501. package/src/bsdiff/zstd/tests/cli-tests/file-stat/compress-file-to-stdout.sh +0 -8
  502. package/src/bsdiff/zstd/tests/cli-tests/file-stat/compress-file-to-stdout.sh.stderr.exact +0 -24
  503. package/src/bsdiff/zstd/tests/cli-tests/file-stat/compress-stdin-to-file.sh +0 -8
  504. package/src/bsdiff/zstd/tests/cli-tests/file-stat/compress-stdin-to-file.sh.stderr.exact +0 -24
  505. package/src/bsdiff/zstd/tests/cli-tests/file-stat/compress-stdin-to-stdout.sh +0 -8
  506. package/src/bsdiff/zstd/tests/cli-tests/file-stat/compress-stdin-to-stdout.sh.stderr.exact +0 -18
  507. package/src/bsdiff/zstd/tests/cli-tests/file-stat/decompress-file-to-file.sh +0 -8
  508. package/src/bsdiff/zstd/tests/cli-tests/file-stat/decompress-file-to-file.sh.stderr.exact +0 -38
  509. package/src/bsdiff/zstd/tests/cli-tests/file-stat/decompress-file-to-stdout.sh +0 -7
  510. package/src/bsdiff/zstd/tests/cli-tests/file-stat/decompress-file-to-stdout.sh.stderr.exact +0 -18
  511. package/src/bsdiff/zstd/tests/cli-tests/file-stat/decompress-stdin-to-file.sh +0 -7
  512. package/src/bsdiff/zstd/tests/cli-tests/file-stat/decompress-stdin-to-file.sh.stderr.exact +0 -20
  513. package/src/bsdiff/zstd/tests/cli-tests/file-stat/decompress-stdin-to-stdout.sh +0 -7
  514. package/src/bsdiff/zstd/tests/cli-tests/file-stat/decompress-stdin-to-stdout.sh.stderr.exact +0 -14
  515. package/src/bsdiff/zstd/tests/cli-tests/progress/no-progress.sh +0 -46
  516. package/src/bsdiff/zstd/tests/cli-tests/progress/no-progress.sh.stderr.glob +0 -96
  517. package/src/bsdiff/zstd/tests/cli-tests/progress/progress.sh +0 -41
  518. package/src/bsdiff/zstd/tests/cli-tests/progress/progress.sh.stderr.glob +0 -62
  519. package/src/bsdiff/zstd/tests/cli-tests/run.py +0 -731
  520. package/src/bsdiff/zstd/tests/cli-tests/zstd-symlinks/setup +0 -6
  521. package/src/bsdiff/zstd/tests/cli-tests/zstd-symlinks/zstdcat.sh +0 -12
  522. package/src/bsdiff/zstd/tests/cli-tests/zstd-symlinks/zstdcat.sh.stdout.exact +0 -8
  523. package/src/bsdiff/zstd/tests/datagencli.c +0 -149
  524. package/src/bsdiff/zstd/tests/decodecorpus.c +0 -1936
  525. package/src/bsdiff/zstd/tests/dict-files/zero-weight-dict +0 -0
  526. package/src/bsdiff/zstd/tests/external_matchfinder.c +0 -140
  527. package/src/bsdiff/zstd/tests/external_matchfinder.h +0 -39
  528. package/src/bsdiff/zstd/tests/fullbench.c +0 -980
  529. package/src/bsdiff/zstd/tests/fuzz/Makefile +0 -277
  530. package/src/bsdiff/zstd/tests/fuzz/README.md +0 -161
  531. package/src/bsdiff/zstd/tests/fuzz/block_decompress.c +0 -53
  532. package/src/bsdiff/zstd/tests/fuzz/block_round_trip.c +0 -103
  533. package/src/bsdiff/zstd/tests/fuzz/decompress_cross_format.c +0 -130
  534. package/src/bsdiff/zstd/tests/fuzz/decompress_dstSize_tooSmall.c +0 -74
  535. package/src/bsdiff/zstd/tests/fuzz/dictionary_decompress.c +0 -77
  536. package/src/bsdiff/zstd/tests/fuzz/dictionary_loader.c +0 -106
  537. package/src/bsdiff/zstd/tests/fuzz/dictionary_round_trip.c +0 -155
  538. package/src/bsdiff/zstd/tests/fuzz/dictionary_stream_round_trip.c +0 -209
  539. package/src/bsdiff/zstd/tests/fuzz/fse_read_ncount.c +0 -100
  540. package/src/bsdiff/zstd/tests/fuzz/fuzz.h +0 -57
  541. package/src/bsdiff/zstd/tests/fuzz/fuzz.py +0 -911
  542. package/src/bsdiff/zstd/tests/fuzz/fuzz_data_producer.c +0 -95
  543. package/src/bsdiff/zstd/tests/fuzz/fuzz_data_producer.h +0 -66
  544. package/src/bsdiff/zstd/tests/fuzz/fuzz_helpers.c +0 -48
  545. package/src/bsdiff/zstd/tests/fuzz/fuzz_helpers.h +0 -81
  546. package/src/bsdiff/zstd/tests/fuzz/fuzz_third_party_seq_prod.h +0 -116
  547. package/src/bsdiff/zstd/tests/fuzz/generate_sequences.c +0 -88
  548. package/src/bsdiff/zstd/tests/fuzz/huf_decompress.c +0 -68
  549. package/src/bsdiff/zstd/tests/fuzz/huf_round_trip.c +0 -137
  550. package/src/bsdiff/zstd/tests/fuzz/raw_dictionary_round_trip.c +0 -119
  551. package/src/bsdiff/zstd/tests/fuzz/regression_driver.c +0 -90
  552. package/src/bsdiff/zstd/tests/fuzz/seekable_roundtrip.c +0 -88
  553. package/src/bsdiff/zstd/tests/fuzz/seq_prod_fuzz_example/Makefile +0 -16
  554. package/src/bsdiff/zstd/tests/fuzz/seq_prod_fuzz_example/README.md +0 -12
  555. package/src/bsdiff/zstd/tests/fuzz/seq_prod_fuzz_example/example_seq_prod.c +0 -52
  556. package/src/bsdiff/zstd/tests/fuzz/sequence_compression_api.c +0 -381
  557. package/src/bsdiff/zstd/tests/fuzz/simple_compress.c +0 -60
  558. package/src/bsdiff/zstd/tests/fuzz/simple_decompress.c +0 -59
  559. package/src/bsdiff/zstd/tests/fuzz/simple_round_trip.c +0 -182
  560. package/src/bsdiff/zstd/tests/fuzz/stream_decompress.c +0 -119
  561. package/src/bsdiff/zstd/tests/fuzz/stream_round_trip.c +0 -218
  562. package/src/bsdiff/zstd/tests/fuzz/zstd_frame_info.c +0 -43
  563. package/src/bsdiff/zstd/tests/fuzz/zstd_helpers.c +0 -207
  564. package/src/bsdiff/zstd/tests/fuzz/zstd_helpers.h +0 -56
  565. package/src/bsdiff/zstd/tests/fuzzer.c +0 -4933
  566. package/src/bsdiff/zstd/tests/golden-compression/PR-3517-block-splitter-corruption-test +0 -1
  567. package/src/bsdiff/zstd/tests/golden-compression/http +0 -1
  568. package/src/bsdiff/zstd/tests/golden-compression/huffman-compressed-larger +0 -0
  569. package/src/bsdiff/zstd/tests/golden-compression/large-literal-and-match-lengths +0 -0
  570. package/src/bsdiff/zstd/tests/golden-decompression/block-128k.zst +0 -0
  571. package/src/bsdiff/zstd/tests/golden-decompression/empty-block.zst +0 -0
  572. package/src/bsdiff/zstd/tests/golden-decompression/rle-first-block.zst +0 -0
  573. package/src/bsdiff/zstd/tests/golden-decompression/zeroSeq_2B.zst +0 -0
  574. package/src/bsdiff/zstd/tests/golden-decompression-errors/off0.bin.zst +0 -0
  575. package/src/bsdiff/zstd/tests/golden-decompression-errors/zeroSeq_extraneous.zst +0 -0
  576. package/src/bsdiff/zstd/tests/golden-dictionaries/http-dict-missing-symbols +0 -0
  577. package/src/bsdiff/zstd/tests/gzip/Makefile +0 -45
  578. package/src/bsdiff/zstd/tests/gzip/gzip-env.sh +0 -46
  579. package/src/bsdiff/zstd/tests/gzip/helin-segv.sh +0 -31
  580. package/src/bsdiff/zstd/tests/gzip/help-version.sh +0 -270
  581. package/src/bsdiff/zstd/tests/gzip/hufts-segv.gz +0 -0
  582. package/src/bsdiff/zstd/tests/gzip/hufts.sh +0 -34
  583. package/src/bsdiff/zstd/tests/gzip/init.cfg +0 -5
  584. package/src/bsdiff/zstd/tests/gzip/init.sh +0 -616
  585. package/src/bsdiff/zstd/tests/gzip/keep.sh +0 -51
  586. package/src/bsdiff/zstd/tests/gzip/list.sh +0 -31
  587. package/src/bsdiff/zstd/tests/gzip/memcpy-abuse.sh +0 -34
  588. package/src/bsdiff/zstd/tests/gzip/mixed.sh +0 -68
  589. package/src/bsdiff/zstd/tests/gzip/null-suffix-clobber.sh +0 -35
  590. package/src/bsdiff/zstd/tests/gzip/stdin.sh +0 -31
  591. package/src/bsdiff/zstd/tests/gzip/test-driver.sh +0 -150
  592. package/src/bsdiff/zstd/tests/gzip/trailing-nul.sh +0 -37
  593. package/src/bsdiff/zstd/tests/gzip/unpack-invalid.sh +0 -36
  594. package/src/bsdiff/zstd/tests/gzip/z-suffix.sh +0 -30
  595. package/src/bsdiff/zstd/tests/gzip/zdiff.sh +0 -48
  596. package/src/bsdiff/zstd/tests/gzip/zgrep-context.sh +0 -47
  597. package/src/bsdiff/zstd/tests/gzip/zgrep-f.sh +0 -43
  598. package/src/bsdiff/zstd/tests/gzip/zgrep-signal.sh +0 -64
  599. package/src/bsdiff/zstd/tests/gzip/znew-k.sh +0 -40
  600. package/src/bsdiff/zstd/tests/invalidDictionaries.c +0 -61
  601. package/src/bsdiff/zstd/tests/legacy.c +0 -260
  602. package/src/bsdiff/zstd/tests/libzstd_builds.sh +0 -104
  603. package/src/bsdiff/zstd/tests/longmatch.c +0 -102
  604. package/src/bsdiff/zstd/tests/loremOut.c +0 -50
  605. package/src/bsdiff/zstd/tests/loremOut.h +0 -15
  606. package/src/bsdiff/zstd/tests/paramgrill.c +0 -2966
  607. package/src/bsdiff/zstd/tests/playTests.sh +0 -1928
  608. package/src/bsdiff/zstd/tests/poolTests.c +0 -271
  609. package/src/bsdiff/zstd/tests/rateLimiter.py +0 -41
  610. package/src/bsdiff/zstd/tests/regression/Makefile +0 -60
  611. package/src/bsdiff/zstd/tests/regression/README.md +0 -28
  612. package/src/bsdiff/zstd/tests/regression/config.c +0 -404
  613. package/src/bsdiff/zstd/tests/regression/config.h +0 -91
  614. package/src/bsdiff/zstd/tests/regression/data.c +0 -631
  615. package/src/bsdiff/zstd/tests/regression/data.h +0 -121
  616. package/src/bsdiff/zstd/tests/regression/levels.h +0 -59
  617. package/src/bsdiff/zstd/tests/regression/method.c +0 -701
  618. package/src/bsdiff/zstd/tests/regression/method.h +0 -65
  619. package/src/bsdiff/zstd/tests/regression/result.c +0 -28
  620. package/src/bsdiff/zstd/tests/regression/result.h +0 -103
  621. package/src/bsdiff/zstd/tests/regression/results.csv +0 -1480
  622. package/src/bsdiff/zstd/tests/regression/test.c +0 -362
  623. package/src/bsdiff/zstd/tests/roundTripCrash.c +0 -241
  624. package/src/bsdiff/zstd/tests/seqgen.c +0 -260
  625. package/src/bsdiff/zstd/tests/seqgen.h +0 -58
  626. package/src/bsdiff/zstd/tests/test-license.py +0 -156
  627. package/src/bsdiff/zstd/tests/test-variants.sh +0 -115
  628. package/src/bsdiff/zstd/tests/test-zstd-versions.py +0 -308
  629. package/src/bsdiff/zstd/tests/zstreamtest.c +0 -3407
  630. package/src/bsdiff/zstd/zlibWrapper/BUCK +0 -22
  631. package/src/bsdiff/zstd/zlibWrapper/Makefile +0 -120
  632. package/src/bsdiff/zstd/zlibWrapper/README.md +0 -163
  633. package/src/bsdiff/zstd/zlibWrapper/examples/example.c +0 -598
  634. package/src/bsdiff/zstd/zlibWrapper/examples/example_original.c +0 -599
  635. package/src/bsdiff/zstd/zlibWrapper/examples/fitblk.c +0 -254
  636. package/src/bsdiff/zstd/zlibWrapper/examples/fitblk_original.c +0 -233
  637. package/src/bsdiff/zstd/zlibWrapper/examples/minigzip.c +0 -605
  638. package/src/bsdiff/zstd/zlibWrapper/examples/zwrapbench.c +0 -1018
  639. package/src/bsdiff/zstd/zlibWrapper/gzclose.c +0 -26
  640. package/src/bsdiff/zstd/zlibWrapper/gzcompatibility.h +0 -68
  641. package/src/bsdiff/zstd/zlibWrapper/gzguts.h +0 -229
  642. package/src/bsdiff/zstd/zlibWrapper/gzlib.c +0 -587
  643. package/src/bsdiff/zstd/zlibWrapper/gzread.c +0 -637
  644. package/src/bsdiff/zstd/zlibWrapper/gzwrite.c +0 -631
  645. package/src/bsdiff/zstd/zlibWrapper/zstd_zlibwrapper.c +0 -1200
  646. package/src/bsdiff/zstd/zlibWrapper/zstd_zlibwrapper.h +0 -91
  647. package/src/objc/build/objcWrapper.o +0 -0
  648. package/src/objc/objcWrapper.m +0 -1380
  649. package/src/zig/build/index.js +0 -782
  650. package/src/zig/build/libObjcWrapper.a +0 -0
  651. package/src/zig/build.zig +0 -29
  652. package/src/zig/macos/application.zig +0 -6
  653. package/src/zig/macos/objc.zig +0 -123
  654. package/src/zig/macos/tray.zig +0 -102
  655. package/src/zig/macos/webview.zig +0 -693
  656. package/src/zig/macos/window.zig +0 -189
  657. package/src/zig/main.zig +0 -16
  658. package/src/zig/rpc/pipesin.zig +0 -202
  659. package/src/zig/rpc/rpc.zig +0 -19
  660. package/src/zig/rpc/schema/handlers.zig +0 -402
  661. package/src/zig/rpc/schema/request.zig +0 -59
  662. package/src/zig/rpc/schema/schema.zig +0 -412
  663. package/src/zig/rpc/stdin.zig +0 -112
  664. package/src/zig/rpc/stdout.zig +0 -106
  665. package/src/zig/rpc/types.zig +0 -41
  666. package/src/zig/utils.zig +0 -49
  667. package/src/zig/zig-out/bin/webview +0 -0
@@ -1,968 +0,0 @@
1
- /*
2
- * Copyright (c) Meta Platforms, Inc. and affiliates.
3
- * All rights reserved.
4
- *
5
- * This source code is licensed under both the BSD-style license (found in the
6
- * LICENSE file in the root directory of this source tree) and the GPLv2 (found
7
- * in the COPYING file in the root directory of this source tree).
8
- * You may select, at your option, one of the above-listed licenses.
9
- */
10
-
11
- #include "zstd_compress_internal.h" /* ZSTD_hashPtr, ZSTD_count, ZSTD_storeSeq */
12
- #include "zstd_fast.h"
13
-
14
- static
15
- ZSTD_ALLOW_POINTER_OVERFLOW_ATTR
16
- void ZSTD_fillHashTableForCDict(ZSTD_matchState_t* ms,
17
- const void* const end,
18
- ZSTD_dictTableLoadMethod_e dtlm)
19
- {
20
- const ZSTD_compressionParameters* const cParams = &ms->cParams;
21
- U32* const hashTable = ms->hashTable;
22
- U32 const hBits = cParams->hashLog + ZSTD_SHORT_CACHE_TAG_BITS;
23
- U32 const mls = cParams->minMatch;
24
- const BYTE* const base = ms->window.base;
25
- const BYTE* ip = base + ms->nextToUpdate;
26
- const BYTE* const iend = ((const BYTE*)end) - HASH_READ_SIZE;
27
- const U32 fastHashFillStep = 3;
28
-
29
- /* Currently, we always use ZSTD_dtlm_full for filling CDict tables.
30
- * Feel free to remove this assert if there's a good reason! */
31
- assert(dtlm == ZSTD_dtlm_full);
32
-
33
- /* Always insert every fastHashFillStep position into the hash table.
34
- * Insert the other positions if their hash entry is empty.
35
- */
36
- for ( ; ip + fastHashFillStep < iend + 2; ip += fastHashFillStep) {
37
- U32 const curr = (U32)(ip - base);
38
- { size_t const hashAndTag = ZSTD_hashPtr(ip, hBits, mls);
39
- ZSTD_writeTaggedIndex(hashTable, hashAndTag, curr); }
40
-
41
- if (dtlm == ZSTD_dtlm_fast) continue;
42
- /* Only load extra positions for ZSTD_dtlm_full */
43
- { U32 p;
44
- for (p = 1; p < fastHashFillStep; ++p) {
45
- size_t const hashAndTag = ZSTD_hashPtr(ip + p, hBits, mls);
46
- if (hashTable[hashAndTag >> ZSTD_SHORT_CACHE_TAG_BITS] == 0) { /* not yet filled */
47
- ZSTD_writeTaggedIndex(hashTable, hashAndTag, curr + p);
48
- } } } }
49
- }
50
-
51
- static
52
- ZSTD_ALLOW_POINTER_OVERFLOW_ATTR
53
- void ZSTD_fillHashTableForCCtx(ZSTD_matchState_t* ms,
54
- const void* const end,
55
- ZSTD_dictTableLoadMethod_e dtlm)
56
- {
57
- const ZSTD_compressionParameters* const cParams = &ms->cParams;
58
- U32* const hashTable = ms->hashTable;
59
- U32 const hBits = cParams->hashLog;
60
- U32 const mls = cParams->minMatch;
61
- const BYTE* const base = ms->window.base;
62
- const BYTE* ip = base + ms->nextToUpdate;
63
- const BYTE* const iend = ((const BYTE*)end) - HASH_READ_SIZE;
64
- const U32 fastHashFillStep = 3;
65
-
66
- /* Currently, we always use ZSTD_dtlm_fast for filling CCtx tables.
67
- * Feel free to remove this assert if there's a good reason! */
68
- assert(dtlm == ZSTD_dtlm_fast);
69
-
70
- /* Always insert every fastHashFillStep position into the hash table.
71
- * Insert the other positions if their hash entry is empty.
72
- */
73
- for ( ; ip + fastHashFillStep < iend + 2; ip += fastHashFillStep) {
74
- U32 const curr = (U32)(ip - base);
75
- size_t const hash0 = ZSTD_hashPtr(ip, hBits, mls);
76
- hashTable[hash0] = curr;
77
- if (dtlm == ZSTD_dtlm_fast) continue;
78
- /* Only load extra positions for ZSTD_dtlm_full */
79
- { U32 p;
80
- for (p = 1; p < fastHashFillStep; ++p) {
81
- size_t const hash = ZSTD_hashPtr(ip + p, hBits, mls);
82
- if (hashTable[hash] == 0) { /* not yet filled */
83
- hashTable[hash] = curr + p;
84
- } } } }
85
- }
86
-
87
- void ZSTD_fillHashTable(ZSTD_matchState_t* ms,
88
- const void* const end,
89
- ZSTD_dictTableLoadMethod_e dtlm,
90
- ZSTD_tableFillPurpose_e tfp)
91
- {
92
- if (tfp == ZSTD_tfp_forCDict) {
93
- ZSTD_fillHashTableForCDict(ms, end, dtlm);
94
- } else {
95
- ZSTD_fillHashTableForCCtx(ms, end, dtlm);
96
- }
97
- }
98
-
99
-
100
- /**
101
- * If you squint hard enough (and ignore repcodes), the search operation at any
102
- * given position is broken into 4 stages:
103
- *
104
- * 1. Hash (map position to hash value via input read)
105
- * 2. Lookup (map hash val to index via hashtable read)
106
- * 3. Load (map index to value at that position via input read)
107
- * 4. Compare
108
- *
109
- * Each of these steps involves a memory read at an address which is computed
110
- * from the previous step. This means these steps must be sequenced and their
111
- * latencies are cumulative.
112
- *
113
- * Rather than do 1->2->3->4 sequentially for a single position before moving
114
- * onto the next, this implementation interleaves these operations across the
115
- * next few positions:
116
- *
117
- * R = Repcode Read & Compare
118
- * H = Hash
119
- * T = Table Lookup
120
- * M = Match Read & Compare
121
- *
122
- * Pos | Time -->
123
- * ----+-------------------
124
- * N | ... M
125
- * N+1 | ... TM
126
- * N+2 | R H T M
127
- * N+3 | H TM
128
- * N+4 | R H T M
129
- * N+5 | H ...
130
- * N+6 | R ...
131
- *
132
- * This is very much analogous to the pipelining of execution in a CPU. And just
133
- * like a CPU, we have to dump the pipeline when we find a match (i.e., take a
134
- * branch).
135
- *
136
- * When this happens, we throw away our current state, and do the following prep
137
- * to re-enter the loop:
138
- *
139
- * Pos | Time -->
140
- * ----+-------------------
141
- * N | H T
142
- * N+1 | H
143
- *
144
- * This is also the work we do at the beginning to enter the loop initially.
145
- */
146
- FORCE_INLINE_TEMPLATE
147
- ZSTD_ALLOW_POINTER_OVERFLOW_ATTR
148
- size_t ZSTD_compressBlock_fast_noDict_generic(
149
- ZSTD_matchState_t* ms, seqStore_t* seqStore, U32 rep[ZSTD_REP_NUM],
150
- void const* src, size_t srcSize,
151
- U32 const mls, U32 const hasStep)
152
- {
153
- const ZSTD_compressionParameters* const cParams = &ms->cParams;
154
- U32* const hashTable = ms->hashTable;
155
- U32 const hlog = cParams->hashLog;
156
- /* support stepSize of 0 */
157
- size_t const stepSize = hasStep ? (cParams->targetLength + !(cParams->targetLength) + 1) : 2;
158
- const BYTE* const base = ms->window.base;
159
- const BYTE* const istart = (const BYTE*)src;
160
- const U32 endIndex = (U32)((size_t)(istart - base) + srcSize);
161
- const U32 prefixStartIndex = ZSTD_getLowestPrefixIndex(ms, endIndex, cParams->windowLog);
162
- const BYTE* const prefixStart = base + prefixStartIndex;
163
- const BYTE* const iend = istart + srcSize;
164
- const BYTE* const ilimit = iend - HASH_READ_SIZE;
165
-
166
- const BYTE* anchor = istart;
167
- const BYTE* ip0 = istart;
168
- const BYTE* ip1;
169
- const BYTE* ip2;
170
- const BYTE* ip3;
171
- U32 current0;
172
-
173
- U32 rep_offset1 = rep[0];
174
- U32 rep_offset2 = rep[1];
175
- U32 offsetSaved1 = 0, offsetSaved2 = 0;
176
-
177
- size_t hash0; /* hash for ip0 */
178
- size_t hash1; /* hash for ip1 */
179
- U32 idx; /* match idx for ip0 */
180
- U32 mval; /* src value at match idx */
181
-
182
- U32 offcode;
183
- const BYTE* match0;
184
- size_t mLength;
185
-
186
- /* ip0 and ip1 are always adjacent. The targetLength skipping and
187
- * uncompressibility acceleration is applied to every other position,
188
- * matching the behavior of #1562. step therefore represents the gap
189
- * between pairs of positions, from ip0 to ip2 or ip1 to ip3. */
190
- size_t step;
191
- const BYTE* nextStep;
192
- const size_t kStepIncr = (1 << (kSearchStrength - 1));
193
-
194
- DEBUGLOG(5, "ZSTD_compressBlock_fast_generic");
195
- ip0 += (ip0 == prefixStart);
196
- { U32 const curr = (U32)(ip0 - base);
197
- U32 const windowLow = ZSTD_getLowestPrefixIndex(ms, curr, cParams->windowLog);
198
- U32 const maxRep = curr - windowLow;
199
- if (rep_offset2 > maxRep) offsetSaved2 = rep_offset2, rep_offset2 = 0;
200
- if (rep_offset1 > maxRep) offsetSaved1 = rep_offset1, rep_offset1 = 0;
201
- }
202
-
203
- /* start each op */
204
- _start: /* Requires: ip0 */
205
-
206
- step = stepSize;
207
- nextStep = ip0 + kStepIncr;
208
-
209
- /* calculate positions, ip0 - anchor == 0, so we skip step calc */
210
- ip1 = ip0 + 1;
211
- ip2 = ip0 + step;
212
- ip3 = ip2 + 1;
213
-
214
- if (ip3 >= ilimit) {
215
- goto _cleanup;
216
- }
217
-
218
- hash0 = ZSTD_hashPtr(ip0, hlog, mls);
219
- hash1 = ZSTD_hashPtr(ip1, hlog, mls);
220
-
221
- idx = hashTable[hash0];
222
-
223
- do {
224
- /* load repcode match for ip[2]*/
225
- const U32 rval = MEM_read32(ip2 - rep_offset1);
226
-
227
- /* write back hash table entry */
228
- current0 = (U32)(ip0 - base);
229
- hashTable[hash0] = current0;
230
-
231
- /* check repcode at ip[2] */
232
- if ((MEM_read32(ip2) == rval) & (rep_offset1 > 0)) {
233
- ip0 = ip2;
234
- match0 = ip0 - rep_offset1;
235
- mLength = ip0[-1] == match0[-1];
236
- ip0 -= mLength;
237
- match0 -= mLength;
238
- offcode = REPCODE1_TO_OFFBASE;
239
- mLength += 4;
240
-
241
- /* First write next hash table entry; we've already calculated it.
242
- * This write is known to be safe because the ip1 is before the
243
- * repcode (ip2). */
244
- hashTable[hash1] = (U32)(ip1 - base);
245
-
246
- goto _match;
247
- }
248
-
249
- /* load match for ip[0] */
250
- if (idx >= prefixStartIndex) {
251
- mval = MEM_read32(base + idx);
252
- } else {
253
- mval = MEM_read32(ip0) ^ 1; /* guaranteed to not match. */
254
- }
255
-
256
- /* check match at ip[0] */
257
- if (MEM_read32(ip0) == mval) {
258
- /* found a match! */
259
-
260
- /* First write next hash table entry; we've already calculated it.
261
- * This write is known to be safe because the ip1 == ip0 + 1, so
262
- * we know we will resume searching after ip1 */
263
- hashTable[hash1] = (U32)(ip1 - base);
264
-
265
- goto _offset;
266
- }
267
-
268
- /* lookup ip[1] */
269
- idx = hashTable[hash1];
270
-
271
- /* hash ip[2] */
272
- hash0 = hash1;
273
- hash1 = ZSTD_hashPtr(ip2, hlog, mls);
274
-
275
- /* advance to next positions */
276
- ip0 = ip1;
277
- ip1 = ip2;
278
- ip2 = ip3;
279
-
280
- /* write back hash table entry */
281
- current0 = (U32)(ip0 - base);
282
- hashTable[hash0] = current0;
283
-
284
- /* load match for ip[0] */
285
- if (idx >= prefixStartIndex) {
286
- mval = MEM_read32(base + idx);
287
- } else {
288
- mval = MEM_read32(ip0) ^ 1; /* guaranteed to not match. */
289
- }
290
-
291
- /* check match at ip[0] */
292
- if (MEM_read32(ip0) == mval) {
293
- /* found a match! */
294
-
295
- /* first write next hash table entry; we've already calculated it */
296
- if (step <= 4) {
297
- /* We need to avoid writing an index into the hash table >= the
298
- * position at which we will pick up our searching after we've
299
- * taken this match.
300
- *
301
- * The minimum possible match has length 4, so the earliest ip0
302
- * can be after we take this match will be the current ip0 + 4.
303
- * ip1 is ip0 + step - 1. If ip1 is >= ip0 + 4, we can't safely
304
- * write this position.
305
- */
306
- hashTable[hash1] = (U32)(ip1 - base);
307
- }
308
-
309
- goto _offset;
310
- }
311
-
312
- /* lookup ip[1] */
313
- idx = hashTable[hash1];
314
-
315
- /* hash ip[2] */
316
- hash0 = hash1;
317
- hash1 = ZSTD_hashPtr(ip2, hlog, mls);
318
-
319
- /* advance to next positions */
320
- ip0 = ip1;
321
- ip1 = ip2;
322
- ip2 = ip0 + step;
323
- ip3 = ip1 + step;
324
-
325
- /* calculate step */
326
- if (ip2 >= nextStep) {
327
- step++;
328
- PREFETCH_L1(ip1 + 64);
329
- PREFETCH_L1(ip1 + 128);
330
- nextStep += kStepIncr;
331
- }
332
- } while (ip3 < ilimit);
333
-
334
- _cleanup:
335
- /* Note that there are probably still a couple positions we could search.
336
- * However, it seems to be a meaningful performance hit to try to search
337
- * them. So let's not. */
338
-
339
- /* When the repcodes are outside of the prefix, we set them to zero before the loop.
340
- * When the offsets are still zero, we need to restore them after the block to have a correct
341
- * repcode history. If only one offset was invalid, it is easy. The tricky case is when both
342
- * offsets were invalid. We need to figure out which offset to refill with.
343
- * - If both offsets are zero they are in the same order.
344
- * - If both offsets are non-zero, we won't restore the offsets from `offsetSaved[12]`.
345
- * - If only one is zero, we need to decide which offset to restore.
346
- * - If rep_offset1 is non-zero, then rep_offset2 must be offsetSaved1.
347
- * - It is impossible for rep_offset2 to be non-zero.
348
- *
349
- * So if rep_offset1 started invalid (offsetSaved1 != 0) and became valid (rep_offset1 != 0), then
350
- * set rep[0] = rep_offset1 and rep[1] = offsetSaved1.
351
- */
352
- offsetSaved2 = ((offsetSaved1 != 0) && (rep_offset1 != 0)) ? offsetSaved1 : offsetSaved2;
353
-
354
- /* save reps for next block */
355
- rep[0] = rep_offset1 ? rep_offset1 : offsetSaved1;
356
- rep[1] = rep_offset2 ? rep_offset2 : offsetSaved2;
357
-
358
- /* Return the last literals size */
359
- return (size_t)(iend - anchor);
360
-
361
- _offset: /* Requires: ip0, idx */
362
-
363
- /* Compute the offset code. */
364
- match0 = base + idx;
365
- rep_offset2 = rep_offset1;
366
- rep_offset1 = (U32)(ip0-match0);
367
- offcode = OFFSET_TO_OFFBASE(rep_offset1);
368
- mLength = 4;
369
-
370
- /* Count the backwards match length. */
371
- while (((ip0>anchor) & (match0>prefixStart)) && (ip0[-1] == match0[-1])) {
372
- ip0--;
373
- match0--;
374
- mLength++;
375
- }
376
-
377
- _match: /* Requires: ip0, match0, offcode */
378
-
379
- /* Count the forward length. */
380
- mLength += ZSTD_count(ip0 + mLength, match0 + mLength, iend);
381
-
382
- ZSTD_storeSeq(seqStore, (size_t)(ip0 - anchor), anchor, iend, offcode, mLength);
383
-
384
- ip0 += mLength;
385
- anchor = ip0;
386
-
387
- /* Fill table and check for immediate repcode. */
388
- if (ip0 <= ilimit) {
389
- /* Fill Table */
390
- assert(base+current0+2 > istart); /* check base overflow */
391
- hashTable[ZSTD_hashPtr(base+current0+2, hlog, mls)] = current0+2; /* here because current+2 could be > iend-8 */
392
- hashTable[ZSTD_hashPtr(ip0-2, hlog, mls)] = (U32)(ip0-2-base);
393
-
394
- if (rep_offset2 > 0) { /* rep_offset2==0 means rep_offset2 is invalidated */
395
- while ( (ip0 <= ilimit) && (MEM_read32(ip0) == MEM_read32(ip0 - rep_offset2)) ) {
396
- /* store sequence */
397
- size_t const rLength = ZSTD_count(ip0+4, ip0+4-rep_offset2, iend) + 4;
398
- { U32 const tmpOff = rep_offset2; rep_offset2 = rep_offset1; rep_offset1 = tmpOff; } /* swap rep_offset2 <=> rep_offset1 */
399
- hashTable[ZSTD_hashPtr(ip0, hlog, mls)] = (U32)(ip0-base);
400
- ip0 += rLength;
401
- ZSTD_storeSeq(seqStore, 0 /*litLen*/, anchor, iend, REPCODE1_TO_OFFBASE, rLength);
402
- anchor = ip0;
403
- continue; /* faster when present (confirmed on gcc-8) ... (?) */
404
- } } }
405
-
406
- goto _start;
407
- }
408
-
409
- #define ZSTD_GEN_FAST_FN(dictMode, mls, step) \
410
- static size_t ZSTD_compressBlock_fast_##dictMode##_##mls##_##step( \
411
- ZSTD_matchState_t* ms, seqStore_t* seqStore, U32 rep[ZSTD_REP_NUM], \
412
- void const* src, size_t srcSize) \
413
- { \
414
- return ZSTD_compressBlock_fast_##dictMode##_generic(ms, seqStore, rep, src, srcSize, mls, step); \
415
- }
416
-
417
- ZSTD_GEN_FAST_FN(noDict, 4, 1)
418
- ZSTD_GEN_FAST_FN(noDict, 5, 1)
419
- ZSTD_GEN_FAST_FN(noDict, 6, 1)
420
- ZSTD_GEN_FAST_FN(noDict, 7, 1)
421
-
422
- ZSTD_GEN_FAST_FN(noDict, 4, 0)
423
- ZSTD_GEN_FAST_FN(noDict, 5, 0)
424
- ZSTD_GEN_FAST_FN(noDict, 6, 0)
425
- ZSTD_GEN_FAST_FN(noDict, 7, 0)
426
-
427
- size_t ZSTD_compressBlock_fast(
428
- ZSTD_matchState_t* ms, seqStore_t* seqStore, U32 rep[ZSTD_REP_NUM],
429
- void const* src, size_t srcSize)
430
- {
431
- U32 const mls = ms->cParams.minMatch;
432
- assert(ms->dictMatchState == NULL);
433
- if (ms->cParams.targetLength > 1) {
434
- switch(mls)
435
- {
436
- default: /* includes case 3 */
437
- case 4 :
438
- return ZSTD_compressBlock_fast_noDict_4_1(ms, seqStore, rep, src, srcSize);
439
- case 5 :
440
- return ZSTD_compressBlock_fast_noDict_5_1(ms, seqStore, rep, src, srcSize);
441
- case 6 :
442
- return ZSTD_compressBlock_fast_noDict_6_1(ms, seqStore, rep, src, srcSize);
443
- case 7 :
444
- return ZSTD_compressBlock_fast_noDict_7_1(ms, seqStore, rep, src, srcSize);
445
- }
446
- } else {
447
- switch(mls)
448
- {
449
- default: /* includes case 3 */
450
- case 4 :
451
- return ZSTD_compressBlock_fast_noDict_4_0(ms, seqStore, rep, src, srcSize);
452
- case 5 :
453
- return ZSTD_compressBlock_fast_noDict_5_0(ms, seqStore, rep, src, srcSize);
454
- case 6 :
455
- return ZSTD_compressBlock_fast_noDict_6_0(ms, seqStore, rep, src, srcSize);
456
- case 7 :
457
- return ZSTD_compressBlock_fast_noDict_7_0(ms, seqStore, rep, src, srcSize);
458
- }
459
-
460
- }
461
- }
462
-
463
- FORCE_INLINE_TEMPLATE
464
- ZSTD_ALLOW_POINTER_OVERFLOW_ATTR
465
- size_t ZSTD_compressBlock_fast_dictMatchState_generic(
466
- ZSTD_matchState_t* ms, seqStore_t* seqStore, U32 rep[ZSTD_REP_NUM],
467
- void const* src, size_t srcSize, U32 const mls, U32 const hasStep)
468
- {
469
- const ZSTD_compressionParameters* const cParams = &ms->cParams;
470
- U32* const hashTable = ms->hashTable;
471
- U32 const hlog = cParams->hashLog;
472
- /* support stepSize of 0 */
473
- U32 const stepSize = cParams->targetLength + !(cParams->targetLength);
474
- const BYTE* const base = ms->window.base;
475
- const BYTE* const istart = (const BYTE*)src;
476
- const BYTE* ip0 = istart;
477
- const BYTE* ip1 = ip0 + stepSize; /* we assert below that stepSize >= 1 */
478
- const BYTE* anchor = istart;
479
- const U32 prefixStartIndex = ms->window.dictLimit;
480
- const BYTE* const prefixStart = base + prefixStartIndex;
481
- const BYTE* const iend = istart + srcSize;
482
- const BYTE* const ilimit = iend - HASH_READ_SIZE;
483
- U32 offset_1=rep[0], offset_2=rep[1];
484
-
485
- const ZSTD_matchState_t* const dms = ms->dictMatchState;
486
- const ZSTD_compressionParameters* const dictCParams = &dms->cParams ;
487
- const U32* const dictHashTable = dms->hashTable;
488
- const U32 dictStartIndex = dms->window.dictLimit;
489
- const BYTE* const dictBase = dms->window.base;
490
- const BYTE* const dictStart = dictBase + dictStartIndex;
491
- const BYTE* const dictEnd = dms->window.nextSrc;
492
- const U32 dictIndexDelta = prefixStartIndex - (U32)(dictEnd - dictBase);
493
- const U32 dictAndPrefixLength = (U32)(istart - prefixStart + dictEnd - dictStart);
494
- const U32 dictHBits = dictCParams->hashLog + ZSTD_SHORT_CACHE_TAG_BITS;
495
-
496
- /* if a dictionary is still attached, it necessarily means that
497
- * it is within window size. So we just check it. */
498
- const U32 maxDistance = 1U << cParams->windowLog;
499
- const U32 endIndex = (U32)((size_t)(istart - base) + srcSize);
500
- assert(endIndex - prefixStartIndex <= maxDistance);
501
- (void)maxDistance; (void)endIndex; /* these variables are not used when assert() is disabled */
502
-
503
- (void)hasStep; /* not currently specialized on whether it's accelerated */
504
-
505
- /* ensure there will be no underflow
506
- * when translating a dict index into a local index */
507
- assert(prefixStartIndex >= (U32)(dictEnd - dictBase));
508
-
509
- if (ms->prefetchCDictTables) {
510
- size_t const hashTableBytes = (((size_t)1) << dictCParams->hashLog) * sizeof(U32);
511
- PREFETCH_AREA(dictHashTable, hashTableBytes);
512
- }
513
-
514
- /* init */
515
- DEBUGLOG(5, "ZSTD_compressBlock_fast_dictMatchState_generic");
516
- ip0 += (dictAndPrefixLength == 0);
517
- /* dictMatchState repCode checks don't currently handle repCode == 0
518
- * disabling. */
519
- assert(offset_1 <= dictAndPrefixLength);
520
- assert(offset_2 <= dictAndPrefixLength);
521
-
522
- /* Outer search loop */
523
- assert(stepSize >= 1);
524
- while (ip1 <= ilimit) { /* repcode check at (ip0 + 1) is safe because ip0 < ip1 */
525
- size_t mLength;
526
- size_t hash0 = ZSTD_hashPtr(ip0, hlog, mls);
527
-
528
- size_t const dictHashAndTag0 = ZSTD_hashPtr(ip0, dictHBits, mls);
529
- U32 dictMatchIndexAndTag = dictHashTable[dictHashAndTag0 >> ZSTD_SHORT_CACHE_TAG_BITS];
530
- int dictTagsMatch = ZSTD_comparePackedTags(dictMatchIndexAndTag, dictHashAndTag0);
531
-
532
- U32 matchIndex = hashTable[hash0];
533
- U32 curr = (U32)(ip0 - base);
534
- size_t step = stepSize;
535
- const size_t kStepIncr = 1 << kSearchStrength;
536
- const BYTE* nextStep = ip0 + kStepIncr;
537
-
538
- /* Inner search loop */
539
- while (1) {
540
- const BYTE* match = base + matchIndex;
541
- const U32 repIndex = curr + 1 - offset_1;
542
- const BYTE* repMatch = (repIndex < prefixStartIndex) ?
543
- dictBase + (repIndex - dictIndexDelta) :
544
- base + repIndex;
545
- const size_t hash1 = ZSTD_hashPtr(ip1, hlog, mls);
546
- size_t const dictHashAndTag1 = ZSTD_hashPtr(ip1, dictHBits, mls);
547
- hashTable[hash0] = curr; /* update hash table */
548
-
549
- if (((U32) ((prefixStartIndex - 1) - repIndex) >=
550
- 3) /* intentional underflow : ensure repIndex isn't overlapping dict + prefix */
551
- && (MEM_read32(repMatch) == MEM_read32(ip0 + 1))) {
552
- const BYTE* const repMatchEnd = repIndex < prefixStartIndex ? dictEnd : iend;
553
- mLength = ZSTD_count_2segments(ip0 + 1 + 4, repMatch + 4, iend, repMatchEnd, prefixStart) + 4;
554
- ip0++;
555
- ZSTD_storeSeq(seqStore, (size_t) (ip0 - anchor), anchor, iend, REPCODE1_TO_OFFBASE, mLength);
556
- break;
557
- }
558
-
559
- if (dictTagsMatch) {
560
- /* Found a possible dict match */
561
- const U32 dictMatchIndex = dictMatchIndexAndTag >> ZSTD_SHORT_CACHE_TAG_BITS;
562
- const BYTE* dictMatch = dictBase + dictMatchIndex;
563
- if (dictMatchIndex > dictStartIndex &&
564
- MEM_read32(dictMatch) == MEM_read32(ip0)) {
565
- /* To replicate extDict parse behavior, we only use dict matches when the normal matchIndex is invalid */
566
- if (matchIndex <= prefixStartIndex) {
567
- U32 const offset = (U32) (curr - dictMatchIndex - dictIndexDelta);
568
- mLength = ZSTD_count_2segments(ip0 + 4, dictMatch + 4, iend, dictEnd, prefixStart) + 4;
569
- while (((ip0 > anchor) & (dictMatch > dictStart))
570
- && (ip0[-1] == dictMatch[-1])) {
571
- ip0--;
572
- dictMatch--;
573
- mLength++;
574
- } /* catch up */
575
- offset_2 = offset_1;
576
- offset_1 = offset;
577
- ZSTD_storeSeq(seqStore, (size_t) (ip0 - anchor), anchor, iend, OFFSET_TO_OFFBASE(offset), mLength);
578
- break;
579
- }
580
- }
581
- }
582
-
583
- if (matchIndex > prefixStartIndex && MEM_read32(match) == MEM_read32(ip0)) {
584
- /* found a regular match */
585
- U32 const offset = (U32) (ip0 - match);
586
- mLength = ZSTD_count(ip0 + 4, match + 4, iend) + 4;
587
- while (((ip0 > anchor) & (match > prefixStart))
588
- && (ip0[-1] == match[-1])) {
589
- ip0--;
590
- match--;
591
- mLength++;
592
- } /* catch up */
593
- offset_2 = offset_1;
594
- offset_1 = offset;
595
- ZSTD_storeSeq(seqStore, (size_t) (ip0 - anchor), anchor, iend, OFFSET_TO_OFFBASE(offset), mLength);
596
- break;
597
- }
598
-
599
- /* Prepare for next iteration */
600
- dictMatchIndexAndTag = dictHashTable[dictHashAndTag1 >> ZSTD_SHORT_CACHE_TAG_BITS];
601
- dictTagsMatch = ZSTD_comparePackedTags(dictMatchIndexAndTag, dictHashAndTag1);
602
- matchIndex = hashTable[hash1];
603
-
604
- if (ip1 >= nextStep) {
605
- step++;
606
- nextStep += kStepIncr;
607
- }
608
- ip0 = ip1;
609
- ip1 = ip1 + step;
610
- if (ip1 > ilimit) goto _cleanup;
611
-
612
- curr = (U32)(ip0 - base);
613
- hash0 = hash1;
614
- } /* end inner search loop */
615
-
616
- /* match found */
617
- assert(mLength);
618
- ip0 += mLength;
619
- anchor = ip0;
620
-
621
- if (ip0 <= ilimit) {
622
- /* Fill Table */
623
- assert(base+curr+2 > istart); /* check base overflow */
624
- hashTable[ZSTD_hashPtr(base+curr+2, hlog, mls)] = curr+2; /* here because curr+2 could be > iend-8 */
625
- hashTable[ZSTD_hashPtr(ip0-2, hlog, mls)] = (U32)(ip0-2-base);
626
-
627
- /* check immediate repcode */
628
- while (ip0 <= ilimit) {
629
- U32 const current2 = (U32)(ip0-base);
630
- U32 const repIndex2 = current2 - offset_2;
631
- const BYTE* repMatch2 = repIndex2 < prefixStartIndex ?
632
- dictBase - dictIndexDelta + repIndex2 :
633
- base + repIndex2;
634
- if ( ((U32)((prefixStartIndex-1) - (U32)repIndex2) >= 3 /* intentional overflow */)
635
- && (MEM_read32(repMatch2) == MEM_read32(ip0))) {
636
- const BYTE* const repEnd2 = repIndex2 < prefixStartIndex ? dictEnd : iend;
637
- size_t const repLength2 = ZSTD_count_2segments(ip0+4, repMatch2+4, iend, repEnd2, prefixStart) + 4;
638
- U32 tmpOffset = offset_2; offset_2 = offset_1; offset_1 = tmpOffset; /* swap offset_2 <=> offset_1 */
639
- ZSTD_storeSeq(seqStore, 0, anchor, iend, REPCODE1_TO_OFFBASE, repLength2);
640
- hashTable[ZSTD_hashPtr(ip0, hlog, mls)] = current2;
641
- ip0 += repLength2;
642
- anchor = ip0;
643
- continue;
644
- }
645
- break;
646
- }
647
- }
648
-
649
- /* Prepare for next iteration */
650
- assert(ip0 == anchor);
651
- ip1 = ip0 + stepSize;
652
- }
653
-
654
- _cleanup:
655
- /* save reps for next block */
656
- rep[0] = offset_1;
657
- rep[1] = offset_2;
658
-
659
- /* Return the last literals size */
660
- return (size_t)(iend - anchor);
661
- }
662
-
663
-
664
- ZSTD_GEN_FAST_FN(dictMatchState, 4, 0)
665
- ZSTD_GEN_FAST_FN(dictMatchState, 5, 0)
666
- ZSTD_GEN_FAST_FN(dictMatchState, 6, 0)
667
- ZSTD_GEN_FAST_FN(dictMatchState, 7, 0)
668
-
669
- size_t ZSTD_compressBlock_fast_dictMatchState(
670
- ZSTD_matchState_t* ms, seqStore_t* seqStore, U32 rep[ZSTD_REP_NUM],
671
- void const* src, size_t srcSize)
672
- {
673
- U32 const mls = ms->cParams.minMatch;
674
- assert(ms->dictMatchState != NULL);
675
- switch(mls)
676
- {
677
- default: /* includes case 3 */
678
- case 4 :
679
- return ZSTD_compressBlock_fast_dictMatchState_4_0(ms, seqStore, rep, src, srcSize);
680
- case 5 :
681
- return ZSTD_compressBlock_fast_dictMatchState_5_0(ms, seqStore, rep, src, srcSize);
682
- case 6 :
683
- return ZSTD_compressBlock_fast_dictMatchState_6_0(ms, seqStore, rep, src, srcSize);
684
- case 7 :
685
- return ZSTD_compressBlock_fast_dictMatchState_7_0(ms, seqStore, rep, src, srcSize);
686
- }
687
- }
688
-
689
-
690
- static
691
- ZSTD_ALLOW_POINTER_OVERFLOW_ATTR
692
- size_t ZSTD_compressBlock_fast_extDict_generic(
693
- ZSTD_matchState_t* ms, seqStore_t* seqStore, U32 rep[ZSTD_REP_NUM],
694
- void const* src, size_t srcSize, U32 const mls, U32 const hasStep)
695
- {
696
- const ZSTD_compressionParameters* const cParams = &ms->cParams;
697
- U32* const hashTable = ms->hashTable;
698
- U32 const hlog = cParams->hashLog;
699
- /* support stepSize of 0 */
700
- size_t const stepSize = cParams->targetLength + !(cParams->targetLength) + 1;
701
- const BYTE* const base = ms->window.base;
702
- const BYTE* const dictBase = ms->window.dictBase;
703
- const BYTE* const istart = (const BYTE*)src;
704
- const BYTE* anchor = istart;
705
- const U32 endIndex = (U32)((size_t)(istart - base) + srcSize);
706
- const U32 lowLimit = ZSTD_getLowestMatchIndex(ms, endIndex, cParams->windowLog);
707
- const U32 dictStartIndex = lowLimit;
708
- const BYTE* const dictStart = dictBase + dictStartIndex;
709
- const U32 dictLimit = ms->window.dictLimit;
710
- const U32 prefixStartIndex = dictLimit < lowLimit ? lowLimit : dictLimit;
711
- const BYTE* const prefixStart = base + prefixStartIndex;
712
- const BYTE* const dictEnd = dictBase + prefixStartIndex;
713
- const BYTE* const iend = istart + srcSize;
714
- const BYTE* const ilimit = iend - 8;
715
- U32 offset_1=rep[0], offset_2=rep[1];
716
- U32 offsetSaved1 = 0, offsetSaved2 = 0;
717
-
718
- const BYTE* ip0 = istart;
719
- const BYTE* ip1;
720
- const BYTE* ip2;
721
- const BYTE* ip3;
722
- U32 current0;
723
-
724
-
725
- size_t hash0; /* hash for ip0 */
726
- size_t hash1; /* hash for ip1 */
727
- U32 idx; /* match idx for ip0 */
728
- const BYTE* idxBase; /* base pointer for idx */
729
-
730
- U32 offcode;
731
- const BYTE* match0;
732
- size_t mLength;
733
- const BYTE* matchEnd = 0; /* initialize to avoid warning, assert != 0 later */
734
-
735
- size_t step;
736
- const BYTE* nextStep;
737
- const size_t kStepIncr = (1 << (kSearchStrength - 1));
738
-
739
- (void)hasStep; /* not currently specialized on whether it's accelerated */
740
-
741
- DEBUGLOG(5, "ZSTD_compressBlock_fast_extDict_generic (offset_1=%u)", offset_1);
742
-
743
- /* switch to "regular" variant if extDict is invalidated due to maxDistance */
744
- if (prefixStartIndex == dictStartIndex)
745
- return ZSTD_compressBlock_fast(ms, seqStore, rep, src, srcSize);
746
-
747
- { U32 const curr = (U32)(ip0 - base);
748
- U32 const maxRep = curr - dictStartIndex;
749
- if (offset_2 >= maxRep) offsetSaved2 = offset_2, offset_2 = 0;
750
- if (offset_1 >= maxRep) offsetSaved1 = offset_1, offset_1 = 0;
751
- }
752
-
753
- /* start each op */
754
- _start: /* Requires: ip0 */
755
-
756
- step = stepSize;
757
- nextStep = ip0 + kStepIncr;
758
-
759
- /* calculate positions, ip0 - anchor == 0, so we skip step calc */
760
- ip1 = ip0 + 1;
761
- ip2 = ip0 + step;
762
- ip3 = ip2 + 1;
763
-
764
- if (ip3 >= ilimit) {
765
- goto _cleanup;
766
- }
767
-
768
- hash0 = ZSTD_hashPtr(ip0, hlog, mls);
769
- hash1 = ZSTD_hashPtr(ip1, hlog, mls);
770
-
771
- idx = hashTable[hash0];
772
- idxBase = idx < prefixStartIndex ? dictBase : base;
773
-
774
- do {
775
- { /* load repcode match for ip[2] */
776
- U32 const current2 = (U32)(ip2 - base);
777
- U32 const repIndex = current2 - offset_1;
778
- const BYTE* const repBase = repIndex < prefixStartIndex ? dictBase : base;
779
- U32 rval;
780
- if ( ((U32)(prefixStartIndex - repIndex) >= 4) /* intentional underflow */
781
- & (offset_1 > 0) ) {
782
- rval = MEM_read32(repBase + repIndex);
783
- } else {
784
- rval = MEM_read32(ip2) ^ 1; /* guaranteed to not match. */
785
- }
786
-
787
- /* write back hash table entry */
788
- current0 = (U32)(ip0 - base);
789
- hashTable[hash0] = current0;
790
-
791
- /* check repcode at ip[2] */
792
- if (MEM_read32(ip2) == rval) {
793
- ip0 = ip2;
794
- match0 = repBase + repIndex;
795
- matchEnd = repIndex < prefixStartIndex ? dictEnd : iend;
796
- assert((match0 != prefixStart) & (match0 != dictStart));
797
- mLength = ip0[-1] == match0[-1];
798
- ip0 -= mLength;
799
- match0 -= mLength;
800
- offcode = REPCODE1_TO_OFFBASE;
801
- mLength += 4;
802
- goto _match;
803
- } }
804
-
805
- { /* load match for ip[0] */
806
- U32 const mval = idx >= dictStartIndex ?
807
- MEM_read32(idxBase + idx) :
808
- MEM_read32(ip0) ^ 1; /* guaranteed not to match */
809
-
810
- /* check match at ip[0] */
811
- if (MEM_read32(ip0) == mval) {
812
- /* found a match! */
813
- goto _offset;
814
- } }
815
-
816
- /* lookup ip[1] */
817
- idx = hashTable[hash1];
818
- idxBase = idx < prefixStartIndex ? dictBase : base;
819
-
820
- /* hash ip[2] */
821
- hash0 = hash1;
822
- hash1 = ZSTD_hashPtr(ip2, hlog, mls);
823
-
824
- /* advance to next positions */
825
- ip0 = ip1;
826
- ip1 = ip2;
827
- ip2 = ip3;
828
-
829
- /* write back hash table entry */
830
- current0 = (U32)(ip0 - base);
831
- hashTable[hash0] = current0;
832
-
833
- { /* load match for ip[0] */
834
- U32 const mval = idx >= dictStartIndex ?
835
- MEM_read32(idxBase + idx) :
836
- MEM_read32(ip0) ^ 1; /* guaranteed not to match */
837
-
838
- /* check match at ip[0] */
839
- if (MEM_read32(ip0) == mval) {
840
- /* found a match! */
841
- goto _offset;
842
- } }
843
-
844
- /* lookup ip[1] */
845
- idx = hashTable[hash1];
846
- idxBase = idx < prefixStartIndex ? dictBase : base;
847
-
848
- /* hash ip[2] */
849
- hash0 = hash1;
850
- hash1 = ZSTD_hashPtr(ip2, hlog, mls);
851
-
852
- /* advance to next positions */
853
- ip0 = ip1;
854
- ip1 = ip2;
855
- ip2 = ip0 + step;
856
- ip3 = ip1 + step;
857
-
858
- /* calculate step */
859
- if (ip2 >= nextStep) {
860
- step++;
861
- PREFETCH_L1(ip1 + 64);
862
- PREFETCH_L1(ip1 + 128);
863
- nextStep += kStepIncr;
864
- }
865
- } while (ip3 < ilimit);
866
-
867
- _cleanup:
868
- /* Note that there are probably still a couple positions we could search.
869
- * However, it seems to be a meaningful performance hit to try to search
870
- * them. So let's not. */
871
-
872
- /* If offset_1 started invalid (offsetSaved1 != 0) and became valid (offset_1 != 0),
873
- * rotate saved offsets. See comment in ZSTD_compressBlock_fast_noDict for more context. */
874
- offsetSaved2 = ((offsetSaved1 != 0) && (offset_1 != 0)) ? offsetSaved1 : offsetSaved2;
875
-
876
- /* save reps for next block */
877
- rep[0] = offset_1 ? offset_1 : offsetSaved1;
878
- rep[1] = offset_2 ? offset_2 : offsetSaved2;
879
-
880
- /* Return the last literals size */
881
- return (size_t)(iend - anchor);
882
-
883
- _offset: /* Requires: ip0, idx, idxBase */
884
-
885
- /* Compute the offset code. */
886
- { U32 const offset = current0 - idx;
887
- const BYTE* const lowMatchPtr = idx < prefixStartIndex ? dictStart : prefixStart;
888
- matchEnd = idx < prefixStartIndex ? dictEnd : iend;
889
- match0 = idxBase + idx;
890
- offset_2 = offset_1;
891
- offset_1 = offset;
892
- offcode = OFFSET_TO_OFFBASE(offset);
893
- mLength = 4;
894
-
895
- /* Count the backwards match length. */
896
- while (((ip0>anchor) & (match0>lowMatchPtr)) && (ip0[-1] == match0[-1])) {
897
- ip0--;
898
- match0--;
899
- mLength++;
900
- } }
901
-
902
- _match: /* Requires: ip0, match0, offcode, matchEnd */
903
-
904
- /* Count the forward length. */
905
- assert(matchEnd != 0);
906
- mLength += ZSTD_count_2segments(ip0 + mLength, match0 + mLength, iend, matchEnd, prefixStart);
907
-
908
- ZSTD_storeSeq(seqStore, (size_t)(ip0 - anchor), anchor, iend, offcode, mLength);
909
-
910
- ip0 += mLength;
911
- anchor = ip0;
912
-
913
- /* write next hash table entry */
914
- if (ip1 < ip0) {
915
- hashTable[hash1] = (U32)(ip1 - base);
916
- }
917
-
918
- /* Fill table and check for immediate repcode. */
919
- if (ip0 <= ilimit) {
920
- /* Fill Table */
921
- assert(base+current0+2 > istart); /* check base overflow */
922
- hashTable[ZSTD_hashPtr(base+current0+2, hlog, mls)] = current0+2; /* here because current+2 could be > iend-8 */
923
- hashTable[ZSTD_hashPtr(ip0-2, hlog, mls)] = (U32)(ip0-2-base);
924
-
925
- while (ip0 <= ilimit) {
926
- U32 const repIndex2 = (U32)(ip0-base) - offset_2;
927
- const BYTE* const repMatch2 = repIndex2 < prefixStartIndex ? dictBase + repIndex2 : base + repIndex2;
928
- if ( (((U32)((prefixStartIndex-1) - repIndex2) >= 3) & (offset_2 > 0)) /* intentional underflow */
929
- && (MEM_read32(repMatch2) == MEM_read32(ip0)) ) {
930
- const BYTE* const repEnd2 = repIndex2 < prefixStartIndex ? dictEnd : iend;
931
- size_t const repLength2 = ZSTD_count_2segments(ip0+4, repMatch2+4, iend, repEnd2, prefixStart) + 4;
932
- { U32 const tmpOffset = offset_2; offset_2 = offset_1; offset_1 = tmpOffset; } /* swap offset_2 <=> offset_1 */
933
- ZSTD_storeSeq(seqStore, 0 /*litlen*/, anchor, iend, REPCODE1_TO_OFFBASE, repLength2);
934
- hashTable[ZSTD_hashPtr(ip0, hlog, mls)] = (U32)(ip0-base);
935
- ip0 += repLength2;
936
- anchor = ip0;
937
- continue;
938
- }
939
- break;
940
- } }
941
-
942
- goto _start;
943
- }
944
-
945
- ZSTD_GEN_FAST_FN(extDict, 4, 0)
946
- ZSTD_GEN_FAST_FN(extDict, 5, 0)
947
- ZSTD_GEN_FAST_FN(extDict, 6, 0)
948
- ZSTD_GEN_FAST_FN(extDict, 7, 0)
949
-
950
- size_t ZSTD_compressBlock_fast_extDict(
951
- ZSTD_matchState_t* ms, seqStore_t* seqStore, U32 rep[ZSTD_REP_NUM],
952
- void const* src, size_t srcSize)
953
- {
954
- U32 const mls = ms->cParams.minMatch;
955
- assert(ms->dictMatchState == NULL);
956
- switch(mls)
957
- {
958
- default: /* includes case 3 */
959
- case 4 :
960
- return ZSTD_compressBlock_fast_extDict_4_0(ms, seqStore, rep, src, srcSize);
961
- case 5 :
962
- return ZSTD_compressBlock_fast_extDict_5_0(ms, seqStore, rep, src, srcSize);
963
- case 6 :
964
- return ZSTD_compressBlock_fast_extDict_6_0(ms, seqStore, rep, src, srcSize);
965
- case 7 :
966
- return ZSTD_compressBlock_fast_extDict_7_0(ms, seqStore, rep, src, srcSize);
967
- }
968
- }