mirror of
https://github.com/python/cpython.git
synced 2025-09-27 10:50:04 +00:00
bpo-39542: Declare _Py_AddToAllObjects() in pycore_object.h (GH-18368)
_Py_AddToAllObjects() is used in bltinmodule.c and typeobject.c when Py_TRACE_REFS is defined. Fix Py_TRACE_REFS build.
This commit is contained in:
parent
b39fb8e847
commit
58f4e1a6ee
3 changed files with 4 additions and 2 deletions
|
@ -82,6 +82,7 @@ extern void _PyDebug_PrintTotalRefs(void);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef Py_TRACE_REFS
|
#ifdef Py_TRACE_REFS
|
||||||
|
extern void _Py_AddToAllObjects(PyObject *op, int force);
|
||||||
extern void _Py_PrintReferences(FILE *);
|
extern void _Py_PrintReferences(FILE *);
|
||||||
extern void _Py_PrintReferenceAddresses(FILE *);
|
extern void _Py_PrintReferenceAddresses(FILE *);
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -93,7 +93,7 @@ static PyObject refchain = {&refchain, &refchain};
|
||||||
* way, though; exceptions include statically allocated type objects, and
|
* way, though; exceptions include statically allocated type objects, and
|
||||||
* statically allocated singletons (like Py_True and Py_None).
|
* statically allocated singletons (like Py_True and Py_None).
|
||||||
*/
|
*/
|
||||||
static void
|
void
|
||||||
_Py_AddToAllObjects(PyObject *op, int force)
|
_Py_AddToAllObjects(PyObject *op, int force)
|
||||||
{
|
{
|
||||||
#ifdef Py_DEBUG
|
#ifdef Py_DEBUG
|
||||||
|
|
|
@ -4,6 +4,7 @@
|
||||||
#include <ctype.h>
|
#include <ctype.h>
|
||||||
#include "ast.h"
|
#include "ast.h"
|
||||||
#undef Yield /* undefine macro conflicting with <winbase.h> */
|
#undef Yield /* undefine macro conflicting with <winbase.h> */
|
||||||
|
#include "pycore_object.h"
|
||||||
#include "pycore_pyerrors.h"
|
#include "pycore_pyerrors.h"
|
||||||
#include "pycore_pystate.h"
|
#include "pycore_pystate.h"
|
||||||
#include "pycore_tupleobject.h"
|
#include "pycore_tupleobject.h"
|
||||||
|
@ -2443,7 +2444,7 @@ builtin_sum_impl(PyObject *module, PyObject *iterable, PyObject *start)
|
||||||
would change the value of empty. In fact, using
|
would change the value of empty. In fact, using
|
||||||
in-place addition rather that binary addition for
|
in-place addition rather that binary addition for
|
||||||
any of the steps introduces subtle behavior changes:
|
any of the steps introduces subtle behavior changes:
|
||||||
|
|
||||||
https://bugs.python.org/issue18305 */
|
https://bugs.python.org/issue18305 */
|
||||||
temp = PyNumber_Add(result, item);
|
temp = PyNumber_Add(result, item);
|
||||||
Py_DECREF(result);
|
Py_DECREF(result);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue