mirror of
https://github.com/python/cpython.git
synced 2025-07-12 13:55:34 +00:00
bpo-39573: Add Py_SET_SIZE() function (GH-18400)
Add Py_SET_SIZE() function to set the size of an object.
This commit is contained in:
parent
877ea88934
commit
b10dc3e7a1
5 changed files with 15 additions and 2 deletions
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue