[Python-checkins] r63615 - in python/branches/okkoto-sizeof: Objects/listobject.c Python/sysmodule.c
robert.schuppenies
python-checkins at python.org
Sun May 25 10:16:16 CEST 2008
Author: robert.schuppenies
Date: Sun May 25 10:16:16 2008
New Revision: 63615
Log:
streamlined code
Modified:
python/branches/okkoto-sizeof/Objects/listobject.c
python/branches/okkoto-sizeof/Python/sysmodule.c
Modified: python/branches/okkoto-sizeof/Objects/listobject.c
==============================================================================
--- python/branches/okkoto-sizeof/Objects/listobject.c (original)
+++ python/branches/okkoto-sizeof/Objects/listobject.c Sun May 25 10:16:16 2008
@@ -2425,7 +2425,7 @@
{
Py_ssize_t res;
- res = sizeof(PyListObject) + self->allocated * sizeof(self->ob_item);
+ res = sizeof(PyListObject) + self->allocated * sizeof(void*);
return PyLong_FromLong(res);
}
Modified: python/branches/okkoto-sizeof/Python/sysmodule.c
==============================================================================
--- python/branches/okkoto-sizeof/Python/sysmodule.c (original)
+++ python/branches/okkoto-sizeof/Python/sysmodule.c Sun May 25 10:16:16 2008
@@ -643,11 +643,9 @@
sys_getsizeof(PyObject *self, PyObject *args)
{
PyObject *res;
-
res = PyObject_CallMethod(args, "__sizeof__", NULL);
if (res < 0 && PyErr_Occurred())
return NULL;
-
return res;
}
More information about the Python-checkins
mailing list