summaryrefslogtreecommitdiffstats
path: root/Objects
diff options
context:
space:
mode:
authorVictor Stinner <vstinner@python.org>2020-02-07 11:05:12 (GMT)
committerGitHub <noreply@github.com>2020-02-07 11:05:12 (GMT)
commitb10dc3e7a11fcdb97e285882eba6da92594f90f9 (patch)
tree6c304386f0a2be9d0d6213cbb45b3ff78f60b040 /Objects
parent877ea88934a5164be4d9f15207694fad4173d87d (diff)
downloadcpython-b10dc3e7a11fcdb97e285882eba6da92594f90f9.zip
cpython-b10dc3e7a11fcdb97e285882eba6da92594f90f9.tar.gz
cpython-b10dc3e7a11fcdb97e285882eba6da92594f90f9.tar.bz2
bpo-39573: Add Py_SET_SIZE() function (GH-18400)
Add Py_SET_SIZE() function to set the size of an object.
Diffstat (limited to 'Objects')
-rw-r--r--Objects/object.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/Objects/object.c b/Objects/object.c
index ff6c497..81de3b8 100644
--- a/Objects/object.c
+++ b/Objects/object.c
@@ -160,7 +160,7 @@ PyObject_InitVar(PyVarObject *op, PyTypeObject *tp, Py_ssize_t size)
return (PyVarObject *) PyErr_NoMemory();
}
- Py_SIZE(op) = size;
+ Py_SET_SIZE(op, size);
PyObject_Init((PyObject *)op, tp);
return op;
}