mirror of
https://github.com/python/cpython.git
synced 2025-08-04 00:48:58 +00:00
bpo-33583: Add note in PyObject_GC_Resize() doc (GH-7021)
This commit is contained in:
parent
e253752191
commit
1179f4b40f
2 changed files with 2 additions and 1 deletions
|
@ -1752,6 +1752,7 @@ _PyObject_GC_Resize(PyVarObject *op, Py_ssize_t nitems)
|
|||
{
|
||||
const size_t basicsize = _PyObject_VAR_SIZE(Py_TYPE(op), nitems);
|
||||
PyGC_Head *g = AS_GC(op);
|
||||
assert(!IS_TRACKED(op));
|
||||
if (basicsize > PY_SSIZE_T_MAX - sizeof(PyGC_Head))
|
||||
return (PyVarObject *)PyErr_NoMemory();
|
||||
g = (PyGC_Head *)PyObject_REALLOC(g, sizeof(PyGC_Head) + basicsize);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue