1. 10 Jun, 2002 7 commits
    • Guido van Rossum's avatar
      Undo the last chunk of the previous patch, putting back a useful · cab05807
      Guido van Rossum authored
      assert into PyType_Ready(): now that we're not clearing tp_dict, we
      can assert that it's non-NULL again.
      cab05807
    • Guido van Rossum's avatar
      In the recent python-dev thread "Bizarre new test failure", we · a3862097
      Guido van Rossum authored
      discovered that subtype_traverse must traverse the type if it is a
      heap type, because otherwise some cycles involving a type and its
      instance would not be collected.  Simplest example:
          while 1:
              class C(object): pass
              C.ref = C()
      This program grows without bounds before this fix.  (It grows ever
      slower since it spends ever more time in the collector.)
      
      Simply adding the right visit() call to subtype_traverse() revealed
      other problems.  With MvL's help we re-learned that type_clear()
      doesn't have to clear *all* references, only the ones that may not be
      cleared by other means.  Careful analysis (see comments in the code)
      revealed that only tp_mro needs to be cleared.  (The previous checkin
      to this file adds a test for tp_mro==NULL to _PyType_Lookup() that's
      essential to prevent crashes due to tp_mro being NULL when
      subtype_dealloc() tries to look for a __del__ method.)  The same kind
      of analysis also revealed that subtype_clear() doesn't need to clear
      the instance dict.
      
      With this fix, a useful property of the collector is once again
      guaranteed: a single gc.collect() call will clear out all garbage.
      (It didn't always before, which put us on the track of this bug.)
      
      Will backport to 2.2.
      a3862097
    • Guido van Rossum's avatar
      Three's a charm: yet another fix for SF bug 551412. Thinking again · 23094985
      Guido van Rossum authored
      about the test case, slot_nb_power gets called on behalf of its second
      argument, but with a non-None modulus it wouldn't check this, and
      believes it is called on behalf of its first argument.  Fix this
      properly, and get rid of the code in _PyType_Lookup() that tries to
      call _PyType_Ready().  But do leave a check for a NULL tp_mro there,
      because this can still legitimately occur.
      
      I'll fix this in 2.2.x too.
      23094985
    • Andrew M. Kuchling's avatar
      Fix typo, and add some reminders · f70a0a84
      Andrew M. Kuchling authored
      f70a0a84
    • Michael W. Hudson's avatar
    • Andrew MacIntyre's avatar
      refresh to pick up recent changes · b3bfa7f9
      Andrew MacIntyre authored
      b3bfa7f9
    • Andrew MacIntyre's avatar
  2. 09 Jun, 2002 5 commits
  3. 07 Jun, 2002 22 commits
  4. 06 Jun, 2002 6 commits