@@ -93,8 +93,6 @@ PyObject_Init(PyObject *op, PyTypeObject *tp)
93
93
"NULL object passed to PyObject_Init" );
94
94
return op ;
95
95
}
96
- if (PyType_IS_GC (tp ))
97
- op = (PyObject * ) PyObject_FROM_GC (op );
98
96
/* Any changes should be reflected in PyObject_INIT (objimpl.h) */
99
97
op -> ob_type = tp ;
100
98
_Py_NewReference (op );
@@ -109,8 +107,6 @@ PyObject_InitVar(PyVarObject *op, PyTypeObject *tp, int size)
109
107
"NULL object passed to PyObject_InitVar" );
110
108
return op ;
111
109
}
112
- if (PyType_IS_GC (tp ))
113
- op = (PyVarObject * ) PyObject_FROM_GC (op );
114
110
/* Any changes should be reflected in PyObject_INIT_VAR */
115
111
op -> ob_size = size ;
116
112
op -> ob_type = tp ;
@@ -125,8 +121,6 @@ _PyObject_New(PyTypeObject *tp)
125
121
op = (PyObject * ) PyObject_MALLOC (_PyObject_SIZE (tp ));
126
122
if (op == NULL )
127
123
return PyErr_NoMemory ();
128
- if (PyType_IS_GC (tp ))
129
- op = (PyObject * ) PyObject_FROM_GC (op );
130
124
return PyObject_INIT (op , tp );
131
125
}
132
126
@@ -137,26 +131,15 @@ _PyObject_NewVar(PyTypeObject *tp, int size)
137
131
op = (PyVarObject * ) PyObject_MALLOC (_PyObject_VAR_SIZE (tp , size ));
138
132
if (op == NULL )
139
133
return (PyVarObject * )PyErr_NoMemory ();
140
- if (PyType_IS_GC (tp ))
141
- op = (PyVarObject * ) PyObject_FROM_GC (op );
142
134
return PyObject_INIT_VAR (op , tp , size );
143
135
}
144
136
145
137
void
146
138
_PyObject_Del (PyObject * op )
147
139
{
148
- if (op && PyType_IS_GC (op -> ob_type )) {
149
- op = (PyObject * ) PyObject_AS_GC (op );
150
- }
151
140
PyObject_FREE (op );
152
141
}
153
142
154
- #ifndef WITH_CYCLE_GC
155
- /* extension modules might need these */
156
- void _PyGC_Insert (PyObject * op ) { }
157
- void _PyGC_Remove (PyObject * op ) { }
158
- #endif
159
-
160
143
int
161
144
PyObject_Print (PyObject * op , FILE * fp , int flags )
162
145
{
@@ -215,14 +198,6 @@ void _PyObject_Dump(PyObject* op)
215
198
}
216
199
}
217
200
218
- #ifdef WITH_CYCLE_GC
219
- void _PyGC_Dump (PyGC_Head * op )
220
- {
221
- _PyObject_Dump (PyObject_FROM_GC (op ));
222
- }
223
- #endif /* WITH_CYCLE_GC */
224
-
225
-
226
201
PyObject *
227
202
PyObject_Repr (PyObject * v )
228
203
{
@@ -1146,7 +1121,7 @@ _PyObject_GetDictPtr(PyObject *obj)
1146
1121
if (dictoffset == 0 )
1147
1122
return NULL ;
1148
1123
if (dictoffset < 0 ) {
1149
- dictoffset += PyType_BASICSIZE ( tp ) ;
1124
+ dictoffset += tp -> tp_basicsize ;
1150
1125
assert (dictoffset > 0 ); /* Sanity check */
1151
1126
if (tp -> tp_itemsize > 0 ) {
1152
1127
int n = ((PyVarObject * )obj )-> ob_size ;
0 commit comments