summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>1998-11-16 18:56:03 (GMT)
committerGuido van Rossum <guido@python.org>1998-11-16 18:56:03 (GMT)
commit017f7780a88656172af93a2e164b20468fd9c45c (patch)
treef0439aae757ebc18ea290ddf3df126c0b0e318b4
parent72fe0859d07368950f4e3d2919df442ed0dbd019 (diff)
downloadcpython-017f7780a88656172af93a2e164b20468fd9c45c.zip
cpython-017f7780a88656172af93a2e164b20468fd9c45c.tar.gz
cpython-017f7780a88656172af93a2e164b20468fd9c45c.tar.bz2
Make tuples less hungry -- an extra item was allocated but never used.
Tip by Vladimir Marangozov.
-rw-r--r--Objects/tupleobject.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/Objects/tupleobject.c b/Objects/tupleobject.c
index 9bc1fe7..2286b01 100644
--- a/Objects/tupleobject.c
+++ b/Objects/tupleobject.c
@@ -79,7 +79,7 @@ PyTuple_New(size)
#endif
{
op = (PyTupleObject *) malloc(
- sizeof(PyTupleObject) + size * sizeof(PyObject *));
+ sizeof(PyTupleObject) + (size-1) * sizeof(PyObject *));
if (op == NULL)
return PyErr_NoMemory();