commit | 9be2ec109bcec499c1a6971fb4c40d9a8e7886fe | [log] [tgz] |
---|---|---|
author | Robert Schuppenies <okkotonushi@googlemail.com> | Thu Jul 10 15:24:04 2008 +0000 |
committer | Robert Schuppenies <okkotonushi@googlemail.com> | Thu Jul 10 15:24:04 2008 +0000 |
tree | 04942da45d0452f8555758be18bfa3effda1dedb | |
parent | cc3f2b1d1677b4464f223c2fbff77f1b8bd6df0a [diff] [blame] |
Added additional __sizeof__ implementations and addressed comments made in Issue3122.
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 @@ { 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); }