File tree Expand file tree Collapse file tree 2 files changed +9
-13
lines changed Expand file tree Collapse file tree 2 files changed +9
-13
lines changed Original file line number Diff line number Diff line change @@ -110,7 +110,15 @@ _PyFrame_NumSlotsForCodeObject(PyCodeObject *code)
110
110
return code -> co_framesize - FRAME_SPECIALS_SIZE ;
111
111
}
112
112
113
- void _PyFrame_Copy (_PyInterpreterFrame * src , _PyInterpreterFrame * dest );
113
+ static inline void _PyFrame_Copy (_PyInterpreterFrame * src , _PyInterpreterFrame * dest )
114
+ {
115
+ assert (src -> stacktop >= _PyFrame_GetCode (src )-> co_nlocalsplus );
116
+ Py_ssize_t size = ((char * )& src -> localsplus [src -> stacktop ]) - (char * )src ;
117
+ memcpy (dest , src , size );
118
+ // Don't leave a dangling pointer to the old frame when creating generators
119
+ // and coroutines:
120
+ dest -> previous = NULL ;
121
+ }
114
122
115
123
/* Consumes reference to func and locals.
116
124
Does not initialize frame->previous, which happens
Original file line number Diff line number Diff line change @@ -53,18 +53,6 @@ _PyFrame_MakeAndSetFrameObject(_PyInterpreterFrame *frame)
53
53
return f ;
54
54
}
55
55
56
- void
57
- _PyFrame_Copy (_PyInterpreterFrame * src , _PyInterpreterFrame * dest )
58
- {
59
- assert (src -> stacktop >= _PyFrame_GetCode (src )-> co_nlocalsplus );
60
- Py_ssize_t size = ((char * )& src -> localsplus [src -> stacktop ]) - (char * )src ;
61
- memcpy (dest , src , size );
62
- // Don't leave a dangling pointer to the old frame when creating generators
63
- // and coroutines:
64
- dest -> previous = NULL ;
65
- }
66
-
67
-
68
56
static void
69
57
take_ownership (PyFrameObject * f , _PyInterpreterFrame * frame )
70
58
{
You can’t perform that action at this time.
0 commit comments