summaryrefslogtreecommitdiffstats
path: root/Objects/longobject.c
diff options
context:
space:
mode:
authorRobert Schuppenies <okkotonushi@googlemail.com>2008-07-10 15:24:04 (GMT)
committerRobert Schuppenies <okkotonushi@googlemail.com>2008-07-10 15:24:04 (GMT)
commit9be2ec109bcec499c1a6971fb4c40d9a8e7886fe (patch)
tree04942da45d0452f8555758be18bfa3effda1dedb /Objects/longobject.c
parentcc3f2b1d1677b4464f223c2fbff77f1b8bd6df0a (diff)
downloadcpython-9be2ec109bcec499c1a6971fb4c40d9a8e7886fe.zip
cpython-9be2ec109bcec499c1a6971fb4c40d9a8e7886fe.tar.gz
cpython-9be2ec109bcec499c1a6971fb4c40d9a8e7886fe.tar.bz2
Added additional __sizeof__ implementations and addressed comments made in
Issue3122.
Diffstat (limited to 'Objects/longobject.c')
-rw-r--r--Objects/longobject.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/Objects/longobject.c b/Objects/longobject.c
index c65d0c0..2c228bb 100644
--- a/Objects/longobject.c
+++ b/Objects/longobject.c
@@ -3441,9 +3441,9 @@ long_sizeof(PyLongObject *v)
{
Py_ssize_t res;
- res = sizeof(PyLongObject) + abs(v->ob_size) * sizeof(digit);
+ res = v->ob_type->tp_basicsize;
if (v->ob_size != 0)
- res -= sizeof(digit);
+ res += abs(v->ob_size) * sizeof(digit);
return PyInt_FromSsize_t(res);
}