diff options
author | Victor Stinner <vstinner@redhat.com> | 2018-10-23 15:39:40 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-10-23 15:39:40 (GMT) |
commit | 82af0b63b07aa8d92b50098e382b458143cfc677 (patch) | |
tree | 77c2d497083f78ad622f75ffeb9680c6583d3317 /Include/object.h | |
parent | 96f2c739542d48edd6bd15c26b555c7e59d14cce (diff) | |
download | cpython-82af0b63b07aa8d92b50098e382b458143cfc677.zip cpython-82af0b63b07aa8d92b50098e382b458143cfc677.tar.gz cpython-82af0b63b07aa8d92b50098e382b458143cfc677.tar.bz2 |
bpo-9263: _PyObject_Dump() detects freed memory (GH-10061)
_PyObject_Dump() now uses an heuristic to check if the object memory
has been freed: log "<freed object>" in that case.
The heuristic rely on the debug hooks on Python memory allocators
which fills the memory with DEADBYTE (0xDB) when memory is
deallocated. Use PYTHONMALLOC=debug to always enable these debug
hooks.
Diffstat (limited to 'Include/object.h')
-rw-r--r-- | Include/object.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/Include/object.h b/Include/object.h index c772dea..bcf78af 100644 --- a/Include/object.h +++ b/Include/object.h @@ -521,6 +521,7 @@ struct _Py_Identifier; PyAPI_FUNC(int) PyObject_Print(PyObject *, FILE *, int); PyAPI_FUNC(void) _Py_BreakPoint(void); PyAPI_FUNC(void) _PyObject_Dump(PyObject *); +PyAPI_FUNC(int) _PyObject_IsFreed(PyObject *); #endif PyAPI_FUNC(PyObject *) PyObject_Repr(PyObject *); PyAPI_FUNC(PyObject *) PyObject_Str(PyObject *); |