]> granicus.if.org Git - python/commit
bpo-35059: Convert _PyObject_GC_TRACK() to inline function (GH-10643)
authorVictor Stinner <vstinner@redhat.com>
Thu, 22 Nov 2018 00:02:54 +0000 (01:02 +0100)
committerGitHub <noreply@github.com>
Thu, 22 Nov 2018 00:02:54 +0000 (01:02 +0100)
commit271753a27aca2e13275f0827080b915fb438107a
tree63bb4ea49b621175c73e6a696466e5ef997ba911
parentf1d002c1e094922b0f17a820f90ff102d68ab253
bpo-35059: Convert _PyObject_GC_TRACK() to inline function (GH-10643)

* Add _PyObject_ASSERT_FROM() and _PyObject_ASSERT_FAILED_MSG()
  macros.
* PyObject_GC_Track() now calls _PyObject_ASSERT_FAILED_MSG(),
  instead of Py_FatalError(), if the object is already tracked, to
  dump more information on error.
* _PyObject_GC_TRACK() no longer checks if the object is already
  tracked at runtime, use an assertion instead for best performances;
  PyObject_GC_Track() still checks at runtime.
* pycore_object.h now includes pycore_pystate.h.
* Convert _PyObject_GC_TRACK() and _PyObject_GC_UNTRACK() macros to
  inline functions.
Include/internal/pycore_object.h
Include/object.h
Modules/gcmodule.c