Mercurial > hg
view .hgignore @ 35501:12a46ad67a3c
smartset: split generatorset classes to avoid cycle
I uncovered a cycle manifesting in a memory leak by running
`hgperfrevset '::tip'`. The cycle was due to generatorset.__init__
assigning a bound method to self.__contains__. Internet sleuthing
revealed that assigning a bound method to an instance attribute
always creates a cycle.
This commit creates two new variants of generatorset for the special
cases of ascending and descending generators. The special
implementations of __contains__ have been extracted to these classes
where they are defined as __contains__.
generatorset now implements __new__ and changes the spawned type to
one of the new classes if needed.
Differential Revision: https://phab.mercurial-scm.org/D1780
author | Gregory Szorc <gregory.szorc@gmail.com> |
---|---|
date | Wed, 27 Dec 2017 11:08:32 -0700 |
parents | bd8875b6473c |
children | 964212780daf |
line wrap: on
line source
syntax: glob *.elc *.tmp *.orig *.rej *~ *.mergebackup *.o *.so *.dll *.exe *.pyd *.pyc *.pyo *$py.class *.swp *.prof *.zip \#*\# .\#* tests/.coverage* tests/.testtimes* tests/.hypothesis tests/hypothesis-generated tests/annotated tests/exceptions tests/*.err tests/htmlcov build contrib/chg/chg contrib/hgsh/hgsh contrib/vagrant/.vagrant contrib/docker/debian-* contrib/docker/ubuntu-* dist packages doc/common.txt doc/*.[0-9] doc/*.[0-9].txt doc/*.[0-9].gendoc.txt doc/*.[0-9].{x,ht}ml MANIFEST MANIFEST.in patches mercurial/__modulepolicy__.py mercurial/__version__.py mercurial/hgpythonlib.h mercurial.egg-info .DS_Store tags cscope.* .idea/* .asv/* i18n/hg.pot locale/*/LC_MESSAGES/hg.mo hgext/__index__.py # Generated wheels wheelhouse/ syntax: regexp ^\.pc/ ^\.(pydev)?project # hackable windows distribution additions ^hg-python ^hg.py$