[Python-Dev] Stabilizing the C API of 2.6 and 3.0

Andrew MacIntyre andymac at bullseye.apana.org.au
Mon May 26 15:10:43 CEST 2008


Christian Heimes wrote:

> The first set of betas of Python 2.6 and 3.0 is fast apace. I like to
> grab the final chance and clean up the C API of 2.6 and 3.0. I know, I
> know, I brought up the topic two times in the past. But this time I mean
> it for real! :]

On the subject of stabilising the API, I assigned issue 2862 to you
concerning tidying up freelist management interfaces for ints and floats
(http://bugs.python.org/issue2862).

Note that the patch in issue 2862 is essentially orthogonal to the patch
in issue 2039, although any int/float freelist implementation changes
would require amendments.

Additionally, I notice that not all of the types with free lists have
grown routines to clear them - dicts, lists and sets are missing these
routines.  I will add a patch for these in the next few days if no-one
else gets there first.

On the subject of issue 2039, I've come to the view that "explicit is
better than implicit" applies to the freelist management, and with the
addition of freelist clearing routines called from gc.collect() I see
little reason to pursue bounding of freelist sizes (and would suggest
removal of existing bounding code in those freelist implementations that
currently have it).  I have also come to the view that pymalloc's
automatic attempts to return empty arenas to the OS should be changed to
an on-demand cleaning, called after all other cleanup in gc.collect().
Returning arenas, while not expensive in general, is nonetheless not free
(in performance terms).

-- 
-------------------------------------------------------------------------
Andrew I MacIntyre                     "These thoughts are mine alone..."
E-mail: andymac at bullseye.apana.org.au  (pref) | Snail: PO Box 370
        andymac at pcug.org.au             (alt) |        Belconnen ACT 2616
Web:    http://www.andymac.org/               |        Australia


More information about the Python-Dev mailing list