_PyObject_GC_Malloc(): split a complicated line in two. As is, there was

no way to talk the debugger into showing me how many bytes were being
allocated.
This commit is contained in:
Tim Peters 2001-10-06 08:03:20 +00:00
parent 8c2c3d301b
commit 8c18f25850
1 changed files with 3 additions and 2 deletions

View File

@ -802,8 +802,9 @@ _PyObject_GC_Malloc(PyTypeObject *tp, int size)
{
PyObject *op;
#ifdef WITH_CYCLE_GC
PyGC_Head *g = PyObject_MALLOC(_PyObject_VAR_SIZE(tp, size) +
sizeof(PyGC_Head));
const size_t nbytes = sizeof(PyGC_Head) +
(size_t)_PyObject_VAR_SIZE(tp, size);
PyGC_Head *g = PyObject_MALLOC(nbytes);
if (g == NULL)
return (PyObject *)PyErr_NoMemory();
g->gc_next = NULL;