Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 903138f

Browse files
committed
PyObject_Dump(): Use %p format to print the address of the pointer.
PyGC_Dump(): Wrap this in a #ifdef WITH_CYCLE_GC.
1 parent 39e44d7 commit 903138f

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

Objects/object.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -225,13 +225,15 @@ void PyObject_Dump(PyObject* op)
225225
{
226226
(void)PyObject_Print(op, stderr, 0);
227227
fprintf(stderr, "\nrefcounts: %d\n", op->ob_refcnt);
228-
fprintf(stderr, "address : %x\n", op);
228+
fprintf(stderr, "address : %p\n", op);
229229
}
230+
231+
#ifdef WITH_CYCLE_GC
230232
void PyGC_Dump(PyGC_Head* op)
231233
{
232234
PyObject_Dump(PyObject_FROM_GC(op));
233235
}
234-
236+
#endif /* WITH_CYCLE_GC */
235237

236238
PyObject *
237239
PyObject_Repr(PyObject *v)

0 commit comments

Comments
 (0)