From: Tim Peters Date: Sat, 6 Oct 2001 08:03:20 +0000 (+0000) Subject: _PyObject_GC_Malloc(): split a complicated line in two. As is, there was X-Git-Tag: v2.2.1c1~1423 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=8c18f2585032a01b04a99b1acd31a71c7e46f8cb;p=thirdparty%2FPython%2Fcpython.git _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. --- diff --git a/Modules/gcmodule.c b/Modules/gcmodule.c index 30b6839672db..43a7bf131f6b 100644 --- a/Modules/gcmodule.c +++ b/Modules/gcmodule.c @@ -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;