diff options
author | Victor Stinner <vstinner@python.org> | 2020-05-27 12:55:10 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-05-27 12:55:10 (GMT) |
commit | fe2978b3b940fe2478335e3a2ca5ad22338cdf9c (patch) | |
tree | 046e4e97f50b96d62239f8081f7ce6263ef02d78 /Objects/tupleobject.c | |
parent | 20941de0ddc39ce9f07e29b4cc770e8a9ef14d41 (diff) | |
download | cpython-fe2978b3b940fe2478335e3a2ca5ad22338cdf9c.zip cpython-fe2978b3b940fe2478335e3a2ca5ad22338cdf9c.tar.gz cpython-fe2978b3b940fe2478335e3a2ca5ad22338cdf9c.tar.bz2 |
bpo-39573: Convert Py_REFCNT and Py_SIZE to functions (GH-20429)
Convert Py_REFCNT() and Py_SIZE() macros to static inline functions.
They cannot be used as l-value anymore: use Py_SET_REFCNT() and
Py_SET_SIZE() to set an object reference count and size.
Replace &Py_SIZE(self) with &((PyVarObject*)self)->ob_size
in arraymodule.c.
This change is backward incompatible on purpose, to prepare the C API
for an opaque PyObject structure.
Diffstat (limited to 'Objects/tupleobject.c')
-rw-r--r-- | Objects/tupleobject.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/Objects/tupleobject.c b/Objects/tupleobject.c index e4c0c91..43706c2 100644 --- a/Objects/tupleobject.c +++ b/Objects/tupleobject.c @@ -82,7 +82,7 @@ tuple_alloc(Py_ssize_t size) numfree[size]--; /* Inline PyObject_InitVar */ #ifdef Py_TRACE_REFS - Py_SIZE(op) = size; + Py_SET_SIZE(op, size); Py_SET_TYPE(op, &PyTuple_Type); #endif _Py_NewReference((PyObject *)op); |