Commit 0b50ebf2 authored by Barry Warsaw's avatar Barry Warsaw

PyObject_Dump(): Use %p format to print the address of the pointer.

PyGC_Dump(): Wrap this in a #ifdef WITH_CYCLE_GC.
parent ff1bb9ec
...@@ -225,13 +225,15 @@ void PyObject_Dump(PyObject* op) ...@@ -225,13 +225,15 @@ void PyObject_Dump(PyObject* op)
{ {
(void)PyObject_Print(op, stderr, 0); (void)PyObject_Print(op, stderr, 0);
fprintf(stderr, "\nrefcounts: %d\n", op->ob_refcnt); fprintf(stderr, "\nrefcounts: %d\n", op->ob_refcnt);
fprintf(stderr, "address : %x\n", op); fprintf(stderr, "address : %p\n", op);
} }
#ifdef WITH_CYCLE_GC
void PyGC_Dump(PyGC_Head* op) void PyGC_Dump(PyGC_Head* op)
{ {
PyObject_Dump(PyObject_FROM_GC(op)); PyObject_Dump(PyObject_FROM_GC(op));
} }
#endif /* WITH_CYCLE_GC */
PyObject * PyObject *
PyObject_Repr(PyObject *v) PyObject_Repr(PyObject *v)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment