[Zodb-checkins] CVS: ZODB/src/persistent - cPersistence.h:1.28

Jeremy Hylton jeremy at zope.com
Fri Feb 13 23:28:14 EST 2004


Update of /cvs-repository/ZODB/src/persistent
In directory cvs.zope.org:/tmp/cvs-serv9859

Modified Files:
	cPersistence.h 
Log Message:
Add a comment about space used by persistent objects.


=== ZODB/src/persistent/cPersistence.h 1.27 => 1.28 ===
--- ZODB/src/persistent/cPersistence.h:1.27	Fri Nov 28 11:44:55 2003
+++ ZODB/src/persistent/cPersistence.h	Fri Feb 13 23:28:13 2004
@@ -27,6 +27,28 @@
 
 typedef struct ccobject_head_struct PerCache;
 
+/* How big is a persistent object?
+
+   12  PyGC_Head is two pointers and an int
+    8  PyObject_HEAD is an int and a pointer
+ 
+   12  jar, oid, cache pointers
+    8  ring struct
+    8  serialno
+    4  state + extra
+
+  (52) so far
+
+    4  dict ptr
+    4  weaklist ptr
+  -------------------------
+   64  only need 62, but obmalloc rounds up to multiple of eight
+
+  Even a ghost requires 64 bytes.  It's possible to make a persistent
+  instance with slots and no dict, which changes the storage needed.
+
+*/
+
 #define cPersistent_HEAD \
     PyObject_HEAD \
     PyObject *jar; \




More information about the Zodb-checkins mailing list