1. 27 May, 2015 4 commits
    • Kevin Modzelewski's avatar
      Debugging helper: invalidate freed objects · 6fa582e4
      Kevin Modzelewski authored
      Without this, one could use freed objects without issues,
      until something else was allocated in that space.  And even then,
      it would still be a valid object.
      
      So, in debug mode overwrite the data with garbage to try to surface
      these issues.
      
      This exposed an issue with our "nonheap roots" handling, where we
      weren't scanning all of the memory that they pointed to.  This is
      mostly fine, but there are some cases (time.gmtime) where gc-allocated
      memory would be stored in these objects.  So, now you have to register
      the size of the object, and the memory range will be scanned conservatively.
      6fa582e4
    • Kevin Modzelewski's avatar
      3e8f2520
    • Kevin Modzelewski's avatar
      Check destructors and weakrefs for extension objects · 0c0a7da1
      Kevin Modzelewski authored
      Add a new allocation type CONSERVATIVE_PYTHON for extensions objects, for which
      we don't have heap maps, but should still have Python finalization semantics
      (ie destructors and weakrefs).  Previously we were just marking them as
      CONSERVATIVE and skipping them during the sweep phase, and not running destructors
      or handling weakrefs.
      
      It's a bit tricky to figure out when to mark an allocation as conservative vs
      conservative-python; the approach in this commit is to mark all capi-originated
      allocations as conservative, and then when we call PyObject_Init or PyObject_InitVar,
      switch them from conservative to conservative-python.  I think this is more expensive
      but safer than assuming that certain apis will always/never be used as object
      memory.
      
      Unfortunately there are quite a few extension classes that request a custom tp_dealloc,
      and this commit just keeps the old (bad) behavior of ignoring those.  I tried to verify
      as many as I could and they all seem benign, but it will be nice to have
      real destructor support :)
      0c0a7da1
    • Kevin Modzelewski's avatar
  2. 26 May, 2015 15 commits
  3. 25 May, 2015 4 commits
  4. 24 May, 2015 1 commit
  5. 22 May, 2015 16 commits