Skip to content

Commit 6a7c2a9

Browse files
committed
remove calculation of tp_basicsize
1 parent dcd8ef2 commit 6a7c2a9

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

Objects/genobject.c

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -813,8 +813,7 @@ static PyAsyncMethods gen_as_async = {
813813
PyTypeObject PyGen_Type = {
814814
PyVarObject_HEAD_INIT(&PyType_Type, 0)
815815
"generator", /* tp_name */
816-
offsetof(PyGenObject, gi_iframe) +
817-
offsetof(_PyInterpreterFrame, localsplus), /* tp_basicsize */
816+
sizeof(PyGenObject), /* tp_basicsize */
818817
sizeof(PyObject *), /* tp_itemsize */
819818
/* methods */
820819
(destructor)gen_dealloc, /* tp_dealloc */
@@ -1165,8 +1164,7 @@ static PyAsyncMethods coro_as_async = {
11651164
PyTypeObject PyCoro_Type = {
11661165
PyVarObject_HEAD_INIT(&PyType_Type, 0)
11671166
"coroutine", /* tp_name */
1168-
offsetof(PyCoroObject, cr_iframe) +
1169-
offsetof(_PyInterpreterFrame, localsplus), /* tp_basicsize */
1167+
sizeof(PyCoroObject), /* tp_basicsize */
11701168
sizeof(PyObject *), /* tp_itemsize */
11711169
/* methods */
11721170
(destructor)gen_dealloc, /* tp_dealloc */
@@ -1581,8 +1579,7 @@ static PyAsyncMethods async_gen_as_async = {
15811579
PyTypeObject PyAsyncGen_Type = {
15821580
PyVarObject_HEAD_INIT(&PyType_Type, 0)
15831581
"async_generator", /* tp_name */
1584-
offsetof(PyAsyncGenObject, ag_iframe) +
1585-
offsetof(_PyInterpreterFrame, localsplus), /* tp_basicsize */
1582+
sizeof(PyAsyncGenObject), /* tp_basicsize */
15861583
sizeof(PyObject *), /* tp_itemsize */
15871584
/* methods */
15881585
(destructor)gen_dealloc, /* tp_dealloc */

0 commit comments

Comments
 (0)