Skip to content

Commit 81acd9b

Browse files
authored
Apply suggestions from code review
Co-authored-by: Victor Stinner <vstinner@python.org>
1 parent a37528d commit 81acd9b

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

Objects/memoryobject.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3307,9 +3307,9 @@ memory_richcompare(PyObject *v, PyObject *w, int op)
33073307
/* Prevent memoryview object from being released and its underlying buffer
33083308
reshaped during a mixed format comparison loop. */
33093309
// See https://github.com/python/cpython/issues/142663.
3310-
_PyMemoryView_CAST(v)->exports++;
3310+
FT_ATOMIC_ADD_SSIZE(_PyMemoryView_CAST(v)->exports, 1);
33113311
if (w_is_mv) {
3312-
_PyMemoryView_CAST(w)->exports++;
3312+
FT_ATOMIC_ADD_SSIZE(_PyMemoryView_CAST(w)->exports, 1);
33133313
}
33143314

33153315
if (vv->ndim == 0) {
@@ -3329,9 +3329,9 @@ memory_richcompare(PyObject *v, PyObject *w, int op)
33293329
vfmt, unpack_v, unpack_w);
33303330
}
33313331

3332-
_PyMemoryView_CAST(v)->exports--;
3332+
FT_ATOMIC_ADD_SSIZE(_PyMemoryView_CAST(v)->exports, -1);
33333333
if (w_is_mv) {
3334-
_PyMemoryView_CAST(w)->exports--;
3334+
FT_ATOMIC_ADD_SSIZE(_PyMemoryView_CAST(w)->exports, -1);
33353335
}
33363336

33373337
result:

0 commit comments

Comments
 (0)