Skip to content

Commit

Permalink
calculate_log2_keysize: use Windows implementation not just with MSVC
Browse files Browse the repository at this point in the history
The inner loop of build_indices_generic() otherwise never stops since
it gets a full dict and can never find a free slot.
  • Loading branch information
lazka committed Dec 27, 2024
1 parent 70b1f4d commit 26b8ab0
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Objects/dictobject.c
Original file line number Diff line number Diff line change
Expand Up @@ -582,7 +582,7 @@ calculate_log2_keysize(Py_ssize_t minsize)
#if SIZEOF_LONG == SIZEOF_SIZE_T
minsize = (minsize | PyDict_MINSIZE) - 1;
return _Py_bit_length(minsize | (PyDict_MINSIZE-1));
#elif defined(_MSC_VER)
#elif defined(MS_WINDOWS)
// On 64bit Windows, sizeof(long) == 4.
minsize = (minsize | PyDict_MINSIZE) - 1;
unsigned long msb;
Expand Down

0 comments on commit 26b8ab0

Please sign in to comment.