[Zope3-checkins] CVS: Zope3/src/persistence - persistence.c:1.19

Jeremy Hylton jeremy@zope.com
Mon, 30 Jun 2003 17:31:07 -0400


Update of /cvs-repository/Zope3/src/persistence
In directory cvs.zope.org:/tmp/cvs-serv5026

Modified Files:
	persistence.c 
Log Message:
Comment improvements.


=== Zope3/src/persistence/persistence.c 1.18 => 1.19 ===
--- Zope3/src/persistence/persistence.c:1.18	Mon Jun 30 11:52:48 2003
+++ Zope3/src/persistence/persistence.c	Mon Jun 30 17:31:07 2003
@@ -789,12 +789,12 @@
     {NULL}
 };
 
-/* We link this module statically for convenience.  If compiled as a shared
-   library instead, some compilers don't allow addresses of Python objects
-   defined in other libraries to be used in static initializers here.  The
-   DEFERRED_ADDRESS macro is used to tag the slots where such addresses
-   appear; the module init function must fill in the tagged slots at runtime.
-   The argument is for documentation -- the macro ignores it.
+/* This module is compiled as a shared library.  Some compilers don't
+   allow addresses of Python objects defined in other libraries to be
+   used in static initializers here.  The DEFERRED_ADDRESS macro is
+   used to tag the slots where such addresses appear; the module init
+   function must fill in the tagged slots at runtime.  The argument is
+   for documentation -- the macro ignores it.
 */
 #define DEFERRED_ADDRESS(ADDR) 0
 
@@ -846,7 +846,9 @@
 /* PyPersist_MetaType / PersistentMetaClass exists to work around
    problems with the way Python 2.2 determines whether a class's
    instances will get an __dict__, or, more concretely, what the value
-   of tp_dictoffset should be.
+   of tp_dictoffset should be.  The problem is that types with a
+   custom tp_setattro field are not given an __dict__.  The work-around
+   requires a metaclass.
 
    The metaclass uses a custom tp_alloc function PyPersist_Alloc() to
    set tp_dictoffset to -1.  This assignment prevents type_new() from