summaryrefslogtreecommitdiff
path: root/Objects
diff options
context:
space:
mode:
authorVictor Stinner <vstinner@python.org>2020-02-07 12:05:12 +0100
committerGitHub <noreply@github.com>2020-02-07 12:05:12 +0100
commitb10dc3e7a11fcdb97e285882eba6da92594f90f9 (patch)
tree6c304386f0a2be9d0d6213cbb45b3ff78f60b040 /Objects
parent877ea88934a5164be4d9f15207694fad4173d87d (diff)
downloadcpython-git-b10dc3e7a11fcdb97e285882eba6da92594f90f9.tar.gz
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 ff6c497900..81de3b8253 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;
}