mirror of
https://github.com/python/cpython.git
synced 2026-02-22 07:00:51 +00:00
gh-141510: Update mp_length of frozendict to use non atomic operation (gh-144913)
This commit is contained in:
parent
6ef2578f20
commit
fc05e5e3d7
1 changed files with 7 additions and 1 deletions
|
|
@ -3482,6 +3482,12 @@ dict_length(PyObject *self)
|
|||
return GET_USED(_PyAnyDict_CAST(self));
|
||||
}
|
||||
|
||||
static Py_ssize_t
|
||||
frozendict_length(PyObject *self)
|
||||
{
|
||||
return _PyAnyDict_CAST(self)->ma_used;
|
||||
}
|
||||
|
||||
static PyObject *
|
||||
dict_subscript(PyObject *self, PyObject *key)
|
||||
{
|
||||
|
|
@ -7833,7 +7839,7 @@ static PyNumberMethods frozendict_as_number = {
|
|||
};
|
||||
|
||||
static PyMappingMethods frozendict_as_mapping = {
|
||||
.mp_length = dict_length,
|
||||
.mp_length = frozendict_length,
|
||||
.mp_subscript = dict_subscript,
|
||||
};
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue