projects
/
portage.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
433f8f0
)
Use weakref.WeakValueDictionary to make cached Atom instances eligible for
author
Zac Medico
<zmedico@gentoo.org>
Tue, 24 Jun 2008 22:30:48 +0000
(22:30 -0000)
committer
Zac Medico
<zmedico@gentoo.org>
Tue, 24 Jun 2008 22:30:48 +0000
(22:30 -0000)
garbage collection when no strong references remain.
svn path=/main/trunk/; revision=10772
pym/portage/dep.py
patch
|
blob
|
history
diff --git
a/pym/portage/dep.py
b/pym/portage/dep.py
index 3d3b5d954d1f4e80f325cf37b7a10d6ab18441e8..41d6b128b939429d73e316dcb46e913811a13910 100644
(file)
--- a/
pym/portage/dep.py
+++ b/
pym/portage/dep.py
@@
-19,6
+19,7
@@
#
import re, sys, types
+import weakref
from itertools import chain
import portage.exception
from portage.exception import InvalidData, InvalidAtom
@@
-412,7
+413,7
@@
class Atom(object):
"""
__metaclass__ = _AtomCache
- _atoms =
{}
+ _atoms =
weakref.WeakValueDictionary()
_str_methods = ("endswith", "find", "index", "lstrip", "replace",
"startswith", "strip", "rindex", "rfind", "rstrip", "__getitem__",