Skip to content

Commit 423d25a

Browse files
vstinnerencukou
andcommitted
Enhance the doc
Co-authored-by: Petr Viktorin <encukou@gmail.com>
1 parent 94b9315 commit 423d25a

File tree

1 file changed

+10
-4
lines changed

1 file changed

+10
-4
lines changed

Doc/c-api/object.rst

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -89,10 +89,16 @@ Object Protocol
8989
9090
Dump an object *op* to ``stderr``. This should only be used for debugging.
9191
92-
This function can be called without an :term:`attached thread state`, but it's not
93-
recommended to do so.
94-
95-
Implement a heuristic to detect if the object memory has been freed.
92+
The output is intended to try dumping objects even after memory corruption:
93+
94+
* Information is written starting with fields that are the least likely to
95+
crash when accessed.
96+
* This function can be called without an :term:`attached thread state`, but
97+
it's not recommended to do so: it can cause deadlocks.
98+
* An object that does not belong to the current interpreter may be dumped,
99+
but this may also cause crashes or unintended behavior.
100+
* Implement a heuristic to detect if the object memory has been freed. Don't
101+
display the object contents in this case, only its memory address.
96102
97103
Example of output:
98104

0 commit comments

Comments
 (0)