File tree Expand file tree Collapse file tree 2 files changed +9
-3
lines changed Expand file tree Collapse file tree 2 files changed +9
-3
lines changed Original file line number Diff line number Diff line change @@ -217,6 +217,13 @@ extern void _Py_PrintReferences(FILE *);
217
217
extern void _Py_PrintReferenceAddresses (FILE * );
218
218
#endif
219
219
220
+ static inline PyObject * *
221
+ _PyObject_GET_BASIC_WEAKREFS_LISTPTR (PyObject * op )
222
+ {
223
+ Py_ssize_t offset = Py_TYPE (op )-> tp_weaklistoffset ;
224
+ return (PyObject * * )((char * )op + offset );
225
+ }
226
+
220
227
static inline PyObject * *
221
228
_PyObject_GET_WEAKREFS_LISTPTR (PyObject * op )
222
229
{
@@ -226,8 +233,7 @@ _PyObject_GET_WEAKREFS_LISTPTR(PyObject *op)
226
233
(PyTypeObject * )op );
227
234
return _PyStaticType_GET_WEAKREFS_LISTPTR (state );
228
235
}
229
- Py_ssize_t offset = Py_TYPE (op )-> tp_weaklistoffset ;
230
- return (PyObject * * )((char * )op + offset );
236
+ return _PyObject_GET_BASIC_WEAKREFS_LISTPTR (op );
231
237
}
232
238
233
239
// Fast inlined version of PyObject_IS_GC()
Original file line number Diff line number Diff line change @@ -1509,7 +1509,7 @@ subtype_dealloc(PyObject *self)
1509
1509
if (type -> tp_weaklistoffset && !base -> tp_weaklistoffset ) {
1510
1510
/* Modeled after GET_WEAKREFS_LISTPTR() */
1511
1511
PyWeakReference * * list = (PyWeakReference * * ) \
1512
- _PyObject_GET_WEAKREFS_LISTPTR (self );
1512
+ _PyObject_GET_BASIC_WEAKREFS_LISTPTR (self );
1513
1513
while (* list )
1514
1514
_PyWeakref_ClearRef (* list );
1515
1515
}
You can’t perform that action at this time.
0 commit comments