[issue7784] patch for making list/insert at the top of the list avoid memmoves

showell report at bugs.python.org
Tue Jan 26 12:58:26 CET 2010


showell <showell30 at yahoo.com> added the comment:

--- On Tue, 1/26/10, Florent Xicluna <report at bugs.python.org> wrote:

> From: Florent Xicluna <report at bugs.python.org>
> Subject: [issue7784] patch for making list/insert at the top of the list avoid memmoves
> To: showell30 at yahoo.com
> Date: Tuesday, January 26, 2010, 3:53 AM
> 
> Florent Xicluna <laxyf at yahoo.fr>
> added the comment:
> 
> Steve, thank you for your patch.
> 
> IMHO, it's better to provide a patch against trunk (Py2)
> when the optimization is not specific to 3.x.
> 
> I merged it manually on my working copy, and all tests pass
> without leaking. Patch for Py2 attached.
> 
> However, I am not an expert. I just cleaned the tab/space
> mix to conform with what is used in the listobject.c file.
> 

Thank you!  My only rationale for applying the patch to 3.x was that it would minimize backward compatibility concerns, but I do not have a strong opinion either way.

You probably noticed a few stylistic mistakes, such as these lines:

            a->orphans += (-1 * d);
            a->ob_item += (-1 * d);

All feedback on ways to improve this code would be greatly welcome.

Thanks again.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue7784>
_______________________________________


More information about the Python-bugs-list mailing list