mirror of
https://github.com/python/cpython.git
synced 2025-07-24 11:44:31 +00:00
Use pymalloc for realloc() as well.
This commit is contained in:
parent
b26ca9db2e
commit
1b0e4fcc29
1 changed files with 2 additions and 2 deletions
|
@ -873,12 +873,12 @@ _PyObject_GC_Resize(PyVarObject *op, int nitems)
|
||||||
const size_t basicsize = _PyObject_VAR_SIZE(op->ob_type, nitems);
|
const size_t basicsize = _PyObject_VAR_SIZE(op->ob_type, nitems);
|
||||||
#ifdef WITH_CYCLE_GC
|
#ifdef WITH_CYCLE_GC
|
||||||
PyGC_Head *g = AS_GC(op);
|
PyGC_Head *g = AS_GC(op);
|
||||||
g = PyObject_REALLOC(g, sizeof(PyGC_Head) + basicsize);
|
g = _PyMalloc_REALLOC(g, sizeof(PyGC_Head) + basicsize);
|
||||||
if (g == NULL)
|
if (g == NULL)
|
||||||
return (PyVarObject *)PyErr_NoMemory();
|
return (PyVarObject *)PyErr_NoMemory();
|
||||||
op = (PyVarObject *) FROM_GC(g);
|
op = (PyVarObject *) FROM_GC(g);
|
||||||
#else
|
#else
|
||||||
op = PyObject_REALLOC(op, basicsize);
|
op = _PyMalloc_REALLOC(op, basicsize);
|
||||||
if (op == NULL)
|
if (op == NULL)
|
||||||
return (PyVarObject *)PyErr_NoMemory();
|
return (PyVarObject *)PyErr_NoMemory();
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue