File tree Expand file tree Collapse file tree 2 files changed +7
-2
lines changed
graalpython/com.oracle.graal.python.cext Expand file tree Collapse file tree 2 files changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -41,7 +41,12 @@ PyAPI_FUNC(PyObject **) PyTruffleTuple_GetItems(PyObject *op);
4141
4242// GraalPy change: Export PyTuple_SET_ITEM as regular API function to use in PyO3 and others
4343PyAPI_FUNC (void ) PyTuple_SET_ITEM (PyObject * , Py_ssize_t , PyObject * );
44+
45+ /* Inline function to be used in the PyTuple_SET_ITEM macro. */
46+ static inline void graalpy_tuple_set_item (PyObject * op , Py_ssize_t index , PyObject * value ) {
47+ PyTruffleTuple_GetItems (op )[index ] = value ;
48+ }
4449#define PyTuple_SET_ITEM (op , index , value ) \
45- PyTuple_SET_ITEM (_PyObject_CAST(op), (index), _PyObject_CAST(value))
50+ graalpy_tuple_set_item (_PyObject_CAST(op), (index), _PyObject_CAST(value))
4651
4752PyAPI_FUNC (void ) _PyTuple_DebugMallocStats (FILE * out );
Original file line number Diff line number Diff line change @@ -1428,5 +1428,5 @@ _PyTuple_GET_ITEM(PyObject* a, Py_ssize_t b) {
14281428#undef PyTuple_SET_ITEM
14291429// Export PyTuple_SET_ITEM as regular API function to use in PyO3 and others
14301430void PyTuple_SET_ITEM (PyObject * op , Py_ssize_t index , PyObject * value ) {
1431- PyTruffleTuple_GetItems (op )[ index ] = value ;
1431+ graalpy_tuple_set_item (op , index , value ) ;
14321432}
You can’t perform that action at this time.
0 commit comments