mirror of
https://github.com/python/cpython.git
synced 2025-08-03 08:34:29 +00:00
bpo-44032: Move pointer to code object from frame-object to frame specials array. (GH-26771)
This commit is contained in:
parent
7f01f77f8f
commit
0982ded179
6 changed files with 59 additions and 41 deletions
|
@ -8,7 +8,8 @@ enum {
|
|||
FRAME_SPECIALS_GLOBALS_OFFSET = 0,
|
||||
FRAME_SPECIALS_BUILTINS_OFFSET = 1,
|
||||
FRAME_SPECIALS_LOCALS_OFFSET = 2,
|
||||
FRAME_SPECIALS_SIZE = 3
|
||||
FRAME_SPECIALS_CODE_OFFSET = 3,
|
||||
FRAME_SPECIALS_SIZE = 4
|
||||
};
|
||||
|
||||
static inline PyObject **
|
||||
|
@ -30,6 +31,13 @@ _PyFrame_GetBuiltins(PyFrameObject *f)
|
|||
return _PyFrame_Specials(f)[FRAME_SPECIALS_BUILTINS_OFFSET];
|
||||
}
|
||||
|
||||
/* Returns a *borrowed* reference. */
|
||||
static inline PyCodeObject *
|
||||
_PyFrame_GetCode(PyFrameObject *f)
|
||||
{
|
||||
return (PyCodeObject *)_PyFrame_Specials(f)[FRAME_SPECIALS_CODE_OFFSET];
|
||||
}
|
||||
|
||||
int _PyFrame_TakeLocals(PyFrameObject *f);
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue