~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/_simple_set_pyx.pyx

  • Committer: John Arbash Meinel
  • Date: 2010-07-28 21:36:44 UTC
  • mto: This revision was merged to the branch mainline in revision 5369.
  • Revision ID: john@arbash-meinel.com-20100728213644-3k50bbdkq4r1fb9j
SimpleSet now has a __sizeof__ member which knows about its internal table.

Show diffs side-by-side

added added

removed removed

Lines of Context:
115
115
            raise MemoryError()
116
116
        memset(self._table, 0, n_bytes)
117
117
 
 
118
    def __sizeof__(self):
 
119
        return sizeof(SimpleSet) + (self._mask + 1) * (sizeof(PyObject**))
 
120
 
118
121
    def __dealloc__(self):
119
122
        if self._table != NULL:
120
123
            PyMem_Free(self._table)