[Zope-dev] zope2 webdav memory usage...

Chris McDonough chrism at plope.com
Thu Jan 10 20:58:22 EST 2008


Hi folks,

While messing with Zope2's webdav implementation, I ran across this  
bit of memory-management code:

    dflag = hasattr(ob, '_p_changed') and (ob._p_changed == None)
    ... stuff ...
    if dflag:
        ob._p_deactivate()

I actually think this should be:

    dflag = not getattr(ob, '_p_changed', None)
    ... stuff ...
    if dflag:
        ob._p_deactivate()

.. because when _p_changed on a persistent object (as I read it in the  
persistence interface file) is None, the object is a ghost.  The  
object will never be a ghost here because non-_p_ attributes are  
looked up on it before we check for _p_changed, and even if it was a  
ghost, deactivating a ghost (to turn it into a ghost) is just not  
useful.  I think the only time we don't want to deactivate it is if it  
has been changed (when _p_changed is True).  Or at least that seems to  
be the intent.

Does this sound right?  I have a feeling the answer will be crickets,  
but I figure what the heck.

- C



More information about the Zope-Dev mailing list