]> granicus.if.org Git - python/commit
Fix memory leak in dict_to_map(), SF bug [ #485152 ] memory leak in test_scope.
authorJeremy Hylton <jeremy@alum.mit.edu>
Thu, 6 Dec 2001 15:48:16 +0000 (15:48 +0000)
committerJeremy Hylton <jeremy@alum.mit.edu>
Thu, 6 Dec 2001 15:48:16 +0000 (15:48 +0000)
commit1a48ca8c53b80627ebf3c4215140cdc07152556d
treec22b89bcf2e70e08224ddf7677d9010bafa6cb01
parent7802a53e38399e8df647f0633f18658b7bb1be4a
Fix memory leak in dict_to_map(), SF bug [ #485152 ] memory leak in test_scope.

PyCell_Set() incremenets the reference count, so the earlier XINCREF
causes a leak.

Also make a number of small performance improvements to the code on
the assumption that most of the time variables are not rebound across
a FastToLocals() / LocalsToFast() pair.

Replace uses of PyCell_Set() and PyCell_Get() with PyCell_SET() and
PyCell_GET(), since the frame is guaranteed to contain cells.
Objects/frameobject.c