Skip to content

Commit 367e1f4

Browse files
committed
Small cleanups
1 parent 7815db2 commit 367e1f4

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

Include/refcount.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -287,7 +287,6 @@ PyAPI_FUNC(void) _Py_DecRefSharedDebug(PyObject *, const char *, int);
287287
// zero. Otherwise, the thread gives up ownership and merges the reference
288288
// count fields.
289289
PyAPI_FUNC(void) _Py_MergeZeroLocalRefcount(PyObject *);
290-
291290
#endif
292291

293292
#if defined(Py_LIMITED_API) && (Py_LIMITED_API+0 >= 0x030c0000 || defined(Py_REF_DEBUG))

Objects/dictobject.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7110,7 +7110,7 @@ try_set_dict_inline_only_or_other_dict(PyObject *obj, PyObject *new_dict, PyDict
71107110
// We have a materialized dict which doesn't point at the inline values,
71117111
// We get to simply swap dictionaries and free the old dictionary.
71127112
FT_ATOMIC_STORE_PTR(_PyObject_ManagedDictPointer(obj)->dict,
7113-
(PyDictObject *)Py_XNewRef(new_dict));
7113+
(PyDictObject *)Py_XNewRef(new_dict));
71147114
replaced = true;
71157115
goto exit_lock;
71167116
}
@@ -7166,7 +7166,11 @@ static int
71667166
set_or_clear_managed_dict(PyObject *obj, PyObject *new_dict, bool clear)
71677167
{
71687168
assert(Py_TYPE(obj)->tp_flags & Py_TPFLAGS_MANAGED_DICT);
7169+
#ifndef NDEBUG
7170+
Py_BEGIN_CRITICAL_SECTION(obj);
71697171
assert(_PyObject_InlineValuesConsistencyCheck(obj));
7172+
Py_END_CRITICAL_SECTION
7173+
#endif
71707174
int err = 0;
71717175
PyTypeObject *tp = Py_TYPE(obj);
71727176
if (tp->tp_flags & Py_TPFLAGS_INLINE_VALUES) {

0 commit comments

Comments
 (0)