summaryrefslogtreecommitdiffstats
path: root/Modules/gcmodule.c
diff options
context:
space:
mode:
authorTim Peters <tim.peters@gmail.com>2001-10-06 08:03:20 (GMT)
committerTim Peters <tim.peters@gmail.com>2001-10-06 08:03:20 (GMT)
commit8c18f2585032a01b04a99b1acd31a71c7e46f8cb (patch)
treeee7eaf6e11ec5750fca32758b3a838c55baca09c /Modules/gcmodule.c
parent8c2c3d301b38c2b76c462df89669b4deddfcfa6a (diff)
downloadcpython-8c18f2585032a01b04a99b1acd31a71c7e46f8cb.zip
cpython-8c18f2585032a01b04a99b1acd31a71c7e46f8cb.tar.gz
cpython-8c18f2585032a01b04a99b1acd31a71c7e46f8cb.tar.bz2
_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.
Diffstat (limited to 'Modules/gcmodule.c')
-rw-r--r--Modules/gcmodule.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/Modules/gcmodule.c b/Modules/gcmodule.c
index 30b6839..43a7bf1 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;