mirror of
https://github.com/python/cpython.git
synced 2026-01-06 15:32:22 +00:00
bpo-38256: Fix binascii.crc32() when inputs are 4+GiB (GH-32000)
When compiled with `USE_ZLIB_CRC32` defined (`configure` sets this on POSIX systems), `binascii.crc32(...)` failed to compute the correct value when the input data was >= 4GiB. Because the zlib crc32 API is limited to a 32-bit length. This lines it up with the `zlib.crc32(...)` implementation that doesn't have that flaw. **Performance:** This also adopts the same GIL releasing for larger inputs logic that `zlib.crc32` has, and causes the Windows build to always use zlib's crc32 instead of our slow C code as zlib is a required build dependency on Windows.
This commit is contained in:
parent
3ae975f1ac
commit
9d1c4d69db
6 changed files with 87 additions and 31 deletions
|
|
@ -366,7 +366,9 @@
|
|||
<ClCompile Include="..\Modules\arraymodule.c" />
|
||||
<ClCompile Include="..\Modules\atexitmodule.c" />
|
||||
<ClCompile Include="..\Modules\audioop.c" />
|
||||
<ClCompile Include="..\Modules\binascii.c" />
|
||||
<ClCompile Include="..\Modules\binascii.c">
|
||||
<PreprocessorDefinitions>USE_ZLIB_CRC32;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\Modules\cmathmodule.c" />
|
||||
<ClCompile Include="..\Modules\_datetimemodule.c" />
|
||||
<ClCompile Include="..\Modules\errnomodule.c" />
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue