[Python-checkins] r63578 - in python/branches/okkoto-sizeof: Include/abstract.h Include/object.h Objects/abstract.c

robert.schuppenies python-checkins at python.org
Sat May 24 17:34:32 CEST 2008


Author: robert.schuppenies
Date: Sat May 24 17:34:32 2008
New Revision: 63578

Log:
removed old footprint approach


Modified:
   python/branches/okkoto-sizeof/Include/abstract.h
   python/branches/okkoto-sizeof/Include/object.h
   python/branches/okkoto-sizeof/Objects/abstract.c

Modified: python/branches/okkoto-sizeof/Include/abstract.h
==============================================================================
--- python/branches/okkoto-sizeof/Include/abstract.h	(original)
+++ python/branches/okkoto-sizeof/Include/abstract.h	Sat May 24 17:34:32 2008
@@ -418,13 +418,6 @@
 	 equivalent to the Python expression: type(o).
        */
 
-     PyAPI_FUNC(Py_ssize_t) PyObject_Footprint(PyObject *o);
- 
-        /*
-	  Return the memory footprint (i.e. size in bytes) of object o or NULL 
-	  on failure.
-        */
-
      PyAPI_FUNC(Py_ssize_t) PyObject_Size(PyObject *o);
 
        /*

Modified: python/branches/okkoto-sizeof/Include/object.h
==============================================================================
--- python/branches/okkoto-sizeof/Include/object.h	(original)
+++ python/branches/okkoto-sizeof/Include/object.h	Sat May 24 17:34:32 2008
@@ -328,7 +328,6 @@
 typedef int (*initproc)(PyObject *, PyObject *, PyObject *);
 typedef PyObject *(*newfunc)(struct _typeobject *, PyObject *, PyObject *);
 typedef PyObject *(*allocfunc)(struct _typeobject *, Py_ssize_t);
-typedef Py_ssize_t (*footprintfunc)(PyObject *);
 
 typedef struct _typeobject {
 	PyObject_VAR_HEAD
@@ -409,9 +408,6 @@
 	/* Type attribute cache version tag. Added in version 2.6 */
 	unsigned int tp_version_tag;
 
-	/* Memory footprint. Added in version 2.6  */
-	footprintfunc tp_footprint;
-
 #ifdef COUNT_ALLOCS
 	/* these must be last and never explicitly initialized */
 	Py_ssize_t tp_allocs;

Modified: python/branches/okkoto-sizeof/Objects/abstract.c
==============================================================================
--- python/branches/okkoto-sizeof/Objects/abstract.c	(original)
+++ python/branches/okkoto-sizeof/Objects/abstract.c	Sat May 24 17:34:32 2008
@@ -58,36 +58,6 @@
 }
 
 Py_ssize_t
-PyObject_Footprint(PyObject *o)
-{
-	Py_ssize_t res;
-	Py_ssize_t size;
-	footprintfunc m;
-
-	if (o == NULL) {
-		null_error();
-		return -1;
-	}
-
-	m = o->ob_type->tp_footprint;
-	if (m)
-		return o->ob_type->tp_footprint(o);
-
-	res = 0;
-	size = o->ob_type->tp_itemsize;
-	if (size > 0) {
-		Py_ssize_t len;
-		len = PyObject_Size(o);
-		if (len == -1 && PyErr_Occurred())
-			return -1;
-		if (len)
-			res += len * size;
-	}
-	res += o->ob_type->tp_basicsize;
-	return res;
-}
-
-Py_ssize_t
 PyObject_Size(PyObject *o)
 {
 	PySequenceMethods *m;


More information about the Python-checkins mailing list