8000
We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
dk_log2_index_bytes=3
1 parent cef0a90 commit 9af96f4Copy full SHA for 9af96f4
Objects/dictobject.c
@@ -588,11 +588,14 @@ estimate_log2_keysize(Py_ssize_t n)
588
589
/* This immutable, empty PyDictKeysObject is used for PyDict_Clear()
590
* (which cannot fail and thus can do no allocation).
591
+ *
592
+ * See https://github.com/python/cpython/pull/127568#discussion_r1868070614
593
+ * for the rationale of using dk_log2_index_bytes=3 instead of 0.
594
*/
595
static PyDictKeysObject empty_keys_struct = {
596
_Py_DICT_IMMORTAL_INITIAL_REFCNT, /* dk_refcnt */
597
0, /* dk_log2_size */
- 0, /* dk_log2_index_bytes */
598
+ 3, /* dk_log2_index_bytes */
599
DICT_KEYS_UNICODE, /* dk_kind */
600
#ifdef Py_GIL_DISABLED
601
{0}, /* dk_mutex */
0 commit comments