[Python-Dev] Memory leaks in tupleobject.c

Neil Schemenauer nas@arctrix.com
Wed, 13 Dec 2000 15:43:43 -0800


On Thu, Dec 14, 2000 at 12:03:01AM -0600, Charles G Waldman wrote:
>  date: 2000/10/05 19:36:49;  author: nascheme;  state: Exp;  lines: +24 -86
>  Simplify _PyTuple_Resize by not using the tuple free list and dropping
>  support for the last_is_sticky flag.  A few hard to find bugs may be
>  fixed by this patch since the old code was buggy.
> 
> The 2.47 patch seems to have re-introduced the memory leak which was
> fixed in 2.31.  Maybe the old code was buggy, but the "right thing"
> would have been to fix it, not to throw it away.... if _PyTuple_Resize
> simply ignores the tuple free list, memory will be leaked.

Guilty as charged.  Can you explain how the current code is
leaking memory?  I can see one problem with deallocating size=0
tuples.  Are there any more leaks?

  Neil