Skip to content

Commit 4ce1233

Browse files
committed
enable ft
1 parent b6d454a commit 4ce1233

File tree

1 file changed

+3
-12
lines changed

1 file changed

+3
-12
lines changed

Modules/_operator.c

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1602,7 +1602,7 @@ typedef struct {
16021602
vectorcallfunc vectorcall;
16031603
} methodcallerobject;
16041604

1605-
#ifndef Py_GIL_DISABLED
1605+
16061606
static int _methodcaller_initialize_vectorcall(methodcallerobject* mc)
16071607
{
16081608
PyObject* args = mc->xargs;
@@ -1662,10 +1662,10 @@ methodcaller_vectorcall(
16621662

16631663
assert(mc->vectorcall_args != 0);
16641664
size_t buffer_size = sizeof(PyObject *) * (number_of_arguments + 1);
1665-
PyObject **tmp_args = (PyObject **) PyMem_Malloc buffer_size);
1665+
PyObject **tmp_args = (PyObject **) PyMem_Malloc(buffer_size);
16661666
if (tmp_args == NULL) {
16671667
PyErr_NoMemory();
1668-
return -1;
1668+
return NULL;
16691669
}
16701670
memcpy(tmp_args, mc->vectorcall_args, buffer_size);
16711671
tmp_args[0] = args[0];
@@ -1676,7 +1676,6 @@ methodcaller_vectorcall(
16761676

16771677
PyMem_Free(tmp_args);
16781678
}
1679-
#endif
16801679

16811680

16821681
/* AC 3.5: variable number of arguments, not currently support by AC */
@@ -1715,15 +1714,7 @@ methodcaller_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
17151714
mc->kwds = Py_XNewRef(kwds);
17161715
mc->vectorcall_args = 0;
17171716

1718-
1719-
#ifdef Py_GIL_DISABLED
1720-
// gh-127065: The current implementation of methodcaller_vectorcall
1721-
// is not thread-safe because it modifies the `vectorcall_args` array,
1722-
// which is shared across calls.
1723-
mc->vectorcall = NULL;
1724-
#else
17251717
mc->vectorcall = (vectorcallfunc)methodcaller_vectorcall;
1726-
#endif
17271718

17281719
PyObject_GC_Track(mc);
17291720
return (PyObject *)mc;

0 commit comments

Comments
 (0)