We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 0ca174c commit 27566abCopy full SHA for 27566ab
Modules/gcmodule.c
@@ -2353,12 +2353,12 @@ _PyObject_GC_Resize(PyVarObject *op, Py_ssize_t nitems)
2353
if (basicsize > (size_t)PY_SSIZE_T_MAX - presize) {
2354
return (PyVarObject *)PyErr_NoMemory();
2355
}
2356
-
2357
- PyGC_Head *g = AS_GC(op);
2358
- g = (PyGC_Head *)PyObject_Realloc(g, presize + basicsize);
2359
- if (g == NULL)
+ char *mem = (char *)op - presize;
+ mem = (char *)PyObject_Realloc(mem, presize + basicsize);
+ if (mem == NULL) {
2360
2361
- op = (PyVarObject *) FROM_GC(g);
+ }
+ op = (PyVarObject *) (mem + presize);
2362
Py_SET_SIZE(op, nitems);
2363
return op;
2364
0 commit comments