Skip to content

Commit 3fb4444

Browse files
committed
Update Python inlined files: 3.12.7 (4.2)
1 parent ef41701 commit 3fb4444

File tree

10 files changed

+876
-317
lines changed

10 files changed

+876
-317
lines changed

graalpython/com.oracle.graal.python.cext/include/cpython/ceval.h

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,10 @@
33
#endif
44

55
PyAPI_FUNC(void) PyEval_SetProfile(Py_tracefunc, PyObject *);
6+
PyAPI_FUNC(void) PyEval_SetProfileAllThreads(Py_tracefunc, PyObject *);
67
PyAPI_DATA(int) _PyEval_SetProfile(PyThreadState *tstate, Py_tracefunc func, PyObject *arg);
78
PyAPI_FUNC(void) PyEval_SetTrace(Py_tracefunc, PyObject *);
9+
PyAPI_FUNC(void) PyEval_SetTraceAllThreads(Py_tracefunc, PyObject *);
810
PyAPI_FUNC(int) _PyEval_SetTrace(PyThreadState *tstate, Py_tracefunc func, PyObject *arg);
911

1012
/* Helper to look up a builtin object */
@@ -20,7 +22,14 @@ PyAPI_FUNC(PyObject *) _PyEval_EvalFrameDefault(PyThreadState *tstate, struct _P
2022
PyAPI_FUNC(void) _PyEval_SetSwitchInterval(unsigned long microseconds);
2123
PyAPI_FUNC(unsigned long) _PyEval_GetSwitchInterval(void);
2224

23-
PyAPI_FUNC(Py_ssize_t) _PyEval_RequestCodeExtraIndex(freefunc);
25+
PyAPI_FUNC(int) _PyEval_MakePendingCalls(PyThreadState *);
26+
27+
PyAPI_FUNC(Py_ssize_t) PyUnstable_Eval_RequestCodeExtraIndex(freefunc);
28+
// Old name -- remove when this API changes:
29+
_Py_DEPRECATED_EXTERNALLY(3.12) static inline Py_ssize_t
30+
_PyEval_RequestCodeExtraIndex(freefunc f) {
31+
return PyUnstable_Eval_RequestCodeExtraIndex(f);
32+
}
2433

2534
PyAPI_FUNC(int) _PyEval_SliceIndex(PyObject *, Py_ssize_t *);
2635
PyAPI_FUNC(int) _PyEval_SliceIndexNotNone(PyObject *, Py_ssize_t *);

graalpython/com.oracle.graal.python.cext/include/cpython/classobject.h

Lines changed: 24 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -26,12 +26,20 @@ PyAPI_FUNC(PyObject *) PyMethod_New(PyObject *, PyObject *);
2626
PyAPI_FUNC(PyObject *) PyMethod_Function(PyObject *);
2727
PyAPI_FUNC(PyObject *) PyMethod_Self(PyObject *);
2828

29-
/* Macros for direct access to these values. Type checks are *not*
30-
done, so use with care. */
31-
#define PyMethod_GET_FUNCTION(meth) \
32-
(((PyMethodObject *)meth) -> im_func)
33-
#define PyMethod_GET_SELF(meth) \
34-
(((PyMethodObject *)meth) -> im_self)
29+
#define _PyMethod_CAST(meth) \
30+
(assert(PyMethod_Check(meth)), _Py_CAST(PyMethodObject*, meth))
31+
32+
/* Static inline functions for direct access to these values.
33+
Type checks are *not* done, so use with care. */
34+
static inline PyObject* PyMethod_GET_FUNCTION(PyObject *meth) {
35+
return _PyMethod_CAST(meth)->im_func;
36+
}
37+
#define PyMethod_GET_FUNCTION(meth) PyMethod_GET_FUNCTION(_PyObject_CAST(meth))
38+
39+
static inline PyObject* PyMethod_GET_SELF(PyObject *meth) {
40+
return _PyMethod_CAST(meth)->im_self;
41+
}
42+
#define PyMethod_GET_SELF(meth) PyMethod_GET_SELF(_PyObject_CAST(meth))
3543

3644
typedef struct {
3745
PyObject_HEAD
@@ -45,10 +53,16 @@ PyAPI_DATA(PyTypeObject) PyInstanceMethod_Type;
4553
PyAPI_FUNC(PyObject *) PyInstanceMethod_New(PyObject *);
4654
PyAPI_FUNC(PyObject *) PyInstanceMethod_Function(PyObject *);
4755

48-
/* Macros for direct access to these values. Type checks are *not*
49-
done, so use with care. */
50-
#define PyInstanceMethod_GET_FUNCTION(meth) \
51-
(((PyInstanceMethodObject *)meth) -> func)
56+
#define _PyInstanceMethod_CAST(meth) \
57+
(assert(PyInstanceMethod_Check(meth)), \
58+
_Py_CAST(PyInstanceMethodObject*, meth))
59+
60+
/* Static inline function for direct access to these values.
61+
Type checks are *not* done, so use with care. */
62+
static inline PyObject* PyInstanceMethod_GET_FUNCTION(PyObject *meth) {
63+
return _PyInstanceMethod_CAST(meth)->func;
64+
}
65+
#define PyInstanceMethod_GET_FUNCTION(meth) PyInstanceMethod_GET_FUNCTION(_PyObject_CAST(meth))
5266

5367
#ifdef __cplusplus
5468
}

graalpython/com.oracle.graal.python.cext/include/cpython/pystate.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -186,8 +186,7 @@ struct _ts {
186186
*/
187187
unsigned long native_thread_id;
188188

189-
int trash_delete_nesting;
190-
PyObject *trash_delete_later;
189+
struct _py_trashcan trash;
191190

192191
/* Called when a thread state is deleted normally, but not when it
193192
* is destroyed after fork().

0 commit comments

Comments
 (0)