Skip to content

Commit bfe4934

Browse files
committed
Dummy commit to use the macros on the build bots
1 parent e78e018 commit bfe4934

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

Objects/listobject.c

+3-2
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
#include "pycore_long.h" // _PyLong_DigitCount
99
#include "pycore_modsupport.h" // _PyArg_NoKwnames()
1010
#include "pycore_object.h" // _PyObject_GC_TRACK(), _PyDebugAllocatorStats()
11+
#include "pycore_pyatomic_ft_wrappers.h"
1112
#include "pycore_tuple.h" // _PyTuple_FromArray()
1213
#include <stddef.h>
1314

@@ -3399,7 +3400,7 @@ listiter_len(PyObject *self, PyObject *Py_UNUSED(ignored))
33993400
_PyListIterObject *it = (_PyListIterObject *)self;
34003401
Py_ssize_t len;
34013402
if (it->it_seq) {
3402-
len = PyList_GET_SIZE(it->it_seq) - it->it_index;
3403+
len = PyList_GET_SIZE(it->it_seq) - FT_ATOMIC_LOAD_SSIZE_RELAXED(it->it_index);
34033404
if (len >= 0)
34043405
return PyLong_FromSsize_t(len);
34053406
}
@@ -3424,7 +3425,7 @@ listiter_setstate(PyObject *self, PyObject *state)
34243425
index = 0;
34253426
else if (index > PyList_GET_SIZE(it->it_seq))
34263427
index = PyList_GET_SIZE(it->it_seq); /* iterator exhausted */
3427-
it->it_index = index;
3428+
FT_ATOMIC_STORE_SSIZE_RELAXED(it->it_index, index);
34283429
}
34293430
Py_RETURN_NONE;
34303431
}

0 commit comments

Comments
 (0)