Skip to content

Commit 6c3ecd2

Browse files
committed
Raise PyType_Modified for insertion into split dictionary
1 parent 90bf681 commit 6c3ecd2

12 files changed

Lines changed: 1299 additions & 1573 deletions

File tree

Include/internal/pycore_dict.h

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,8 @@ typedef struct {
9090
} PyDictUnicodeEntry;
9191

9292
extern PyDictKeysObject *_PyDict_NewKeysForClass(PyHeapTypeObject *);
93+
extern void _PyDict_RemoveKeysForClass(PyHeapTypeObject *);
94+
extern void _PyDict_SplitKeysInvalidated(PyDictKeysObject* keys);
9395
extern PyObject *_PyDict_FromKeys(PyObject *, PyObject *, PyObject *);
9496

9597
/* Implementations of the `|` and `|=` operators for dict, used by the
@@ -239,6 +241,17 @@ struct _dictkeysobject {
239241
see the DK_ENTRIES() / DK_UNICODE_ENTRIES() functions below */
240242
};
241243

244+
struct _dictsharedkeysobject {
245+
PyTypeObject* dsk_owning_type;
246+
struct _dictkeysobject dsk_keys;
247+
};
248+
249+
static inline struct _dictsharedkeysobject *_PyDictKeys_AsSharedKeys(struct _dictkeysobject *keys)
250+
{
251+
assert(keys->dk_kind == DICT_KEYS_SPLIT);
252+
return _Py_CONTAINER_OF(keys, struct _dictsharedkeysobject, dsk_keys);
253+
}
254+
242255
/* This must be no more than 250, for the prefix size to fit in one byte. */
243256
#define SHARED_KEYS_MAX_SIZE 30
244257
#define NEXT_LOG2_SHARED_KEYS_MAX_SIZE 6

Include/internal/pycore_opcode_metadata.h

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)