mirror of
https://github.com/python/cpython
synced 2026-09-29 10:30:29 +03:00
bpo-35444: Unify and optimize the helper for getting a builtin object. (GH-11047)
This speeds up pickling of some iterators. This fixes also error handling in pickling methods when fail to look up builtin "getattr".
This commit is contained in:
parent
7cf3d8e251
commit
bb86bf4c4e
21 changed files with 68 additions and 72 deletions
|
|
@ -48,10 +48,12 @@ PyAPI_FUNC(PyObject *) PyEval_GetGlobals(void);
|
|||
PyAPI_FUNC(PyObject *) PyEval_GetLocals(void);
|
||||
PyAPI_FUNC(struct _frame *) PyEval_GetFrame(void);
|
||||
|
||||
#ifndef Py_LIMITED_API
|
||||
/* Helper to look up a builtin object */
|
||||
PyAPI_FUNC(PyObject *) _PyEval_GetBuiltinId(_Py_Identifier *);
|
||||
/* Look at the current frame's (if any) code's co_flags, and turn on
|
||||
the corresponding compiler flags in cf->cf_flags. Return 1 if any
|
||||
flag was set, else return 0. */
|
||||
#ifndef Py_LIMITED_API
|
||||
PyAPI_FUNC(int) PyEval_MergeCompilerFlags(PyCompilerFlags *cf);
|
||||
#endif
|
||||
|
||||
|
|
|
|||
|
|
@ -330,9 +330,6 @@ PyAPI_FUNC(int)
|
|||
_PyObject_GenericSetAttrWithDict(PyObject *, PyObject *,
|
||||
PyObject *, PyObject *);
|
||||
|
||||
/* Helper to look up a builtin object */
|
||||
PyAPI_FUNC(PyObject *) _PyObject_GetBuiltin(const char *name);
|
||||
|
||||
#define PyType_HasFeature(t,f) (((t)->tp_flags & (f)) != 0)
|
||||
|
||||
static inline void _Py_Dealloc_inline(PyObject *op)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue