File tree 1 file changed +11
-0
lines changed
1 file changed +11
-0
lines changed Original file line number Diff line number Diff line change @@ -217,13 +217,24 @@ extern void _Py_PrintReferences(FILE *);
217
217
extern void _Py_PrintReferenceAddresses (FILE * );
218
218
#endif
219
219
220
+ /* Return the *address* of the object's weaklist.
221
+ *
222
+ * For static builtin types this will always point to a NULL tp_weaklist.
223
+ * This is fine for any deallocation cases, since static types are never
224
+ * deallocated and static builtin types are only finalized at the end of
225
+ * runtime finalization.
226
+ *
227
+ * If the weaklist for such types is actually needed then use
228
+ * _PyObject_GET_WEAKREFS_LISTPTR().
229
+ */
220
230
static inline PyObject * *
221
231
_PyObject_GET_BASIC_WEAKREFS_LISTPTR (PyObject * op )
222
232
{
223
233
Py_ssize_t offset = Py_TYPE (op )-> tp_weaklistoffset ;
224
234
return (PyObject * * )((char * )op + offset );
225
235
}
226
236
237
+ /* Return the *address* of the object's weaklist. */
227
238
static inline PyObject * *
228
239
_PyObject_GET_WEAKREFS_LISTPTR (PyObject * op )
229
240
{
You can’t perform that action at this time.
0 commit comments