@@ -198,8 +198,18 @@ struct _dictkeysobject {
198198 /* Number of used entries in dk_entries. */
199199 Py_ssize_t dk_nentries ;
200200
201- /* Actual hash table of dk_size entries. It holds indices in dk_entries,
202- or DKIX_EMPTY(-1) or DKIX_DUMMY(-2).
201+ /* Offset to entries within this allocation.
202+
203+ PyDictKeysObject * points to dk_refcnt. The actual hash table
204+ (dk_indices) is stored immediately before the struct in memory;
205+ see _DK_INDICES_END() and _DK_INDICES_BASE().
206+
207+ dk_indices marks the start of the entries array and is used by
208+ DK_ENTRIES() / DK_UNICODE_ENTRIES(). */
209+ char dk_indices []; /* char is required to avoid strict aliasing. */
210+
211+ /* dk_indices is the actual hash table of dk_size entries. It holds
212+ indices in dk_entries, or DKIX_EMPTY(-1) or DKIX_DUMMY(-2).
203213
204214 Indices must be: 0 <= indice < USABLE_FRACTION(dk_size).
205215
@@ -211,10 +221,6 @@ struct _dictkeysobject {
211221 - 8 bytes otherwise (int64_t*)
212222
213223 Dynamically sized, SIZEOF_VOID_P is minimum. */
214- char dk_indices []; /* char is required to avoid strict aliasing. */
215-
216- /* "PyDictKeyEntry or PyDictUnicodeEntry dk_entries[USABLE_FRACTION(DK_SIZE(dk))];" array follows:
217- see the DK_ENTRIES() / DK_UNICODE_ENTRIES() functions below */
218224};
219225
220226/* This must be no more than 250, for the prefix size to fit in one byte. */
0 commit comments