<feed xmlns='http://www.w3.org/2005/Atom'>
<title>python.git/Include/listobject.h, branch 2.4</title>
<subtitle>Unnamed repository; edit this file 'description' to name the repository.</subtitle>
<id>http://dangofactory.net/cgit/cgit.cgi/Server/python.git/atom/Include/listobject.h?h=2.4</id>
<link rel='self' href='http://dangofactory.net/cgit/cgit.cgi/Server/python.git/atom/Include/listobject.h?h=2.4'/>
<link rel='alternate' type='text/html' href='http://dangofactory.net/cgit/cgit.cgi/Server/python.git/'/>
<updated>2004-10-28T16:32:00Z</updated>
<entry>
<title>Wrote down the invariants of some common objects whose structure is</title>
<updated>2004-10-28T16:32:00Z</updated>
<author>
<name>Armin Rigo</name>
<email>arigo@tunes.org</email>
</author>
<published>2004-10-28T16:32:00Z</published>
<link rel='alternate' type='text/html' href='http://dangofactory.net/cgit/cgit.cgi/Server/python.git/commit/?id=89a39461bff04b80bb4857790350e1ab30ff2df9'/>
<id>urn:sha1:89a39461bff04b80bb4857790350e1ab30ff2df9</id>
<content type='text'>
exposed in header files.  Fixed a few comments in these headers.

As we might have expected, writing down invariants systematically exposed a
(minor) bug.  In this case, function objects have a writeable func_code
attribute, which could be set to code objects with the wrong number of
free variables.  Calling the resulting function segfaulted the interpreter.
Added a corresponding test.
</content>
</entry>
<entry>
<title>Fix typo in comment</title>
<updated>2004-08-01T22:45:27Z</updated>
<author>
<name>Neal Norwitz</name>
<email>nnorwitz@gmail.com</email>
</author>
<published>2004-08-01T22:45:27Z</published>
<link rel='alternate' type='text/html' href='http://dangofactory.net/cgit/cgit.cgi/Server/python.git/commit/?id=4ecd8cd046446a6ce0be4098e218f4d17c315d48'/>
<id>urn:sha1:4ecd8cd046446a6ce0be4098e218f4d17c315d48</id>
<content type='text'>
</content>
</entry>
<entry>
<title>* drop the unreasonable list invariant that ob_item should never come back</title>
<updated>2004-07-29T12:40:23Z</updated>
<author>
<name>Armin Rigo</name>
<email>arigo@tunes.org</email>
</author>
<published>2004-07-29T12:40:23Z</published>
<link rel='alternate' type='text/html' href='http://dangofactory.net/cgit/cgit.cgi/Server/python.git/commit/?id=93677f075df9a23c036f4baeb2b9f67c784eadbc'/>
<id>urn:sha1:93677f075df9a23c036f4baeb2b9f67c784eadbc</id>
<content type='text'>
  to NULL during the lifetime of the object.

* listobject.c nevertheless did not conform to the other invariants,
  either; fixed.

* listobject.c now uses list_clear() as the obvious internal way to clear
  a list, instead of abusing list_ass_slice() for that.  It makes it easier
  to enforce the invariant about ob_item == NULL.

* listsort() sets allocated to -1 during sort; any mutation will set it
  to a value &gt;= 0, so it is a safe way to detect mutation.  A negative
  value for allocated does not cause a problem elsewhere currently.
  test_sort.py has a new test for this fix.

* listsort() leak: if items were added to the list during the sort, AND if
  these items had a __del__ that puts still more stuff into the list,
  then this more stuff (and the PyObject** array to hold them) were
  overridden at the end of listsort() and never released.
</content>
</entry>
<entry>
<title>Fix obscure breakage (relative to 2.3) in listsort:  the test for list</title>
<updated>2004-07-29T04:07:15Z</updated>
<author>
<name>Tim Peters</name>
<email>tim.peters@gmail.com</email>
</author>
<published>2004-07-29T04:07:15Z</published>
<link rel='alternate' type='text/html' href='http://dangofactory.net/cgit/cgit.cgi/Server/python.git/commit/?id=51b4ade30615dccaa7f591456528821f4320d5ff'/>
<id>urn:sha1:51b4ade30615dccaa7f591456528821f4320d5ff</id>
<content type='text'>
mutation during list.sort() used to rely on that listobject.c always
NULL'ed ob_item when ob_size fell to 0.  That's no longer true, so the
test for list mutation during a sort is no longer reliable.  Changed the
test to rely instead on that listobject.c now never NULLs-out ob_item
after (if ever) ob_item gets a non-NULL value.  This new assumption is
also documented now, as a required invariant in listobject.h.

The new assumption allowed some real simplification to some of the
hairier code in listsort(), so is a Good Thing on that count.
</content>
</entry>
<entry>
<title>Document what the members of PyListObject are used for, and the crucial</title>
<updated>2004-07-29T03:29:15Z</updated>
<author>
<name>Tim Peters</name>
<email>tim.peters@gmail.com</email>
</author>
<published>2004-07-29T03:29:15Z</published>
<link rel='alternate' type='text/html' href='http://dangofactory.net/cgit/cgit.cgi/Server/python.git/commit/?id=a995a2dd54f904913bfde54317480edf3a3b79c8'/>
<id>urn:sha1:a995a2dd54f904913bfde54317480edf3a3b79c8</id>
<content type='text'>
invariants they must satisfy.
</content>
</entry>
<entry>
<title>Eliminate a big block of duplicate code in PySequence_List() by</title>
<updated>2004-03-11T09:13:12Z</updated>
<author>
<name>Raymond Hettinger</name>
<email>python@rcn.com</email>
</author>
<published>2004-03-11T09:13:12Z</published>
<link rel='alternate' type='text/html' href='http://dangofactory.net/cgit/cgit.cgi/Server/python.git/commit/?id=8ca92ae54c3c0958bf073fe04d897f8f01e02547'/>
<id>urn:sha1:8ca92ae54c3c0958bf073fe04d897f8f01e02547</id>
<content type='text'>
exposing _PyList_Extend().
</content>
</entry>
<entry>
<title>* Optimized list appends and pops by making fewer calls the underlying system</title>
<updated>2004-02-13T11:36:39Z</updated>
<author>
<name>Raymond Hettinger</name>
<email>python@rcn.com</email>
</author>
<published>2004-02-13T11:36:39Z</published>
<link rel='alternate' type='text/html' href='http://dangofactory.net/cgit/cgit.cgi/Server/python.git/commit/?id=4bb9540dd6eddaf60b908796c2412696a8870bd1'/>
<id>urn:sha1:4bb9540dd6eddaf60b908796c2412696a8870bd1</id>
<content type='text'>
  realloc().  This is achieved by tracking the overallocation size in a new
  field and using that information to skip calls to realloc() whenever
  possible.

* Simplified and tightened the amount of overallocation.  For larger lists,
  this overallocates by 1/8th (compared to the previous scheme which ranged
  between 1/4th to 1/32nd over-allocation).  For smaller lists (n&lt;6), the
  maximum overallocation is one byte (formerly it could be upto eight bytes).
  This saves memory in applications with large numbers of small lists.

* Eliminated the NRESIZE macro in favor of a new, static list_resize function
  that encapsulates the resizing logic.  Coverting this back to macro would
  give a small (under 1%) speed-up.  This was too small to warrant the loss
  of readability, maintainability, and de-coupling.

* Some functions using NRESIZE had grown unnecessarily complex in their
  efforts to bend to the macro's calling pattern.  With the new list_resize
  function in place, those other functions could be simplified.  That is
  being saved for a separate patch.

* The ob_item==NULL check could be eliminated from the new list_resize
  function.  This would entail finding each piece of code that sets ob_item
  to NULL and adding a new line to invalidate the overallocation tracking
  field.  Rather than impose a new requirement on other pieces of list code,
  it was preferred to leave the NULL check in place and retain the benefits
  of decoupling, maintainability and information hiding (only PyList_New()
  and list_sort() need to know about the new field).  This approach also
  reduces the odds of breaking an extension module.

(Collaborative effort by Raymond Hettinger, Hye-Shik Chang, Tim Peters,
 and Armin Rigo.)
</content>
</entry>
<entry>
<title>Revert improvement to list.append() checked in before it was ready.</title>
<updated>2004-02-08T11:08:52Z</updated>
<author>
<name>Raymond Hettinger</name>
<email>python@rcn.com</email>
</author>
<published>2004-02-08T11:08:52Z</published>
<link rel='alternate' type='text/html' href='http://dangofactory.net/cgit/cgit.cgi/Server/python.git/commit/?id=204b0006109d12364f608058174a1d352830260f'/>
<id>urn:sha1:204b0006109d12364f608058174a1d352830260f</id>
<content type='text'>
</content>
</entry>
<entry>
<title>Let reversed() work with itself.</title>
<updated>2004-02-08T10:49:42Z</updated>
<author>
<name>Raymond Hettinger</name>
<email>python@rcn.com</email>
</author>
<published>2004-02-08T10:49:42Z</published>
<link rel='alternate' type='text/html' href='http://dangofactory.net/cgit/cgit.cgi/Server/python.git/commit/?id=06353f76beab69a538d3a55ca9b6df7e9754b999'/>
<id>urn:sha1:06353f76beab69a538d3a55ca9b6df7e9754b999</id>
<content type='text'>
</content>
</entry>
<entry>
<title>Excise DL_EXPORT from Include.</title>
<updated>2002-08-12T07:21:58Z</updated>
<author>
<name>Mark Hammond</name>
<email>mhammond@skippinet.com.au</email>
</author>
<published>2002-08-12T07:21:58Z</published>
<link rel='alternate' type='text/html' href='http://dangofactory.net/cgit/cgit.cgi/Server/python.git/commit/?id=91a681debf9ffec155d0aff8a0bb5f965f592e16'/>
<id>urn:sha1:91a681debf9ffec155d0aff8a0bb5f965f592e16</id>
<content type='text'>
Thanks to Skip Montanaro and Kalle Svensson for the patches.
</content>
</entry>
</feed>
