bpo-36389: Add _PyObject_CheckConsistency() function (GH-12803)

Add a new _PyObject_CheckConsistency() function which can be used to
help debugging. The function is available in release mode.

Add a 'check_content' parameter to _PyDict_CheckConsistency().
This commit is contained in:
Victor Stinner 2019-04-12 21:51:34 +02:00 committed by GitHub
parent 23a683adf8
commit 0fc91eef34
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 160 additions and 116 deletions

View file

@ -10,6 +10,10 @@ extern "C" {
#include "pycore_pystate.h" /* _PyRuntime */
PyAPI_FUNC(int) _PyType_CheckConsistency(PyTypeObject *type);
PyAPI_FUNC(int) _PyUnicode_CheckConsistency(PyObject *op, int check_content);
PyAPI_FUNC(int) _PyDict_CheckConsistency(PyObject *mp, int check_content);
/* Tell the GC to track this object.
*
* NB: While the object is tracked by the collector, it must be safe to call the