1 |
Author: zmedico |
2 |
Date: 2008-06-25 10:06:42 +0000 (Wed, 25 Jun 2008) |
3 |
New Revision: 10782 |
4 |
|
5 |
Modified: |
6 |
main/trunk/pym/_emerge/__init__.py |
7 |
main/trunk/pym/portage/dbapi/vartree.py |
8 |
Log: |
9 |
After the depgraph caches the vardb state in a FakeVartree, to make |
10 |
some room on the heap, clear the vardbapi caches. |
11 |
|
12 |
|
13 |
Modified: main/trunk/pym/_emerge/__init__.py |
14 |
=================================================================== |
15 |
--- main/trunk/pym/_emerge/__init__.py 2008-06-25 09:00:23 UTC (rev 10781) |
16 |
+++ main/trunk/pym/_emerge/__init__.py 2008-06-25 10:06:42 UTC (rev 10782) |
17 |
@@ -2025,6 +2025,14 @@ |
18 |
# This triggers metadata updates via FakeVartree. |
19 |
vardb.aux_get(pkg.cpv, []) |
20 |
fakedb.cpv_inject(pkg) |
21 |
+ |
22 |
+ # Now that the vardb state is cached in our FakeVartree, |
23 |
+ # we won't be needing the real vartree cache for awhile. |
24 |
+ # To make some room on the heap, clear the vardbapi |
25 |
+ # caches. |
26 |
+ trees[myroot]["vartree"].dbapi._clear_cache() |
27 |
+ gc.collect() |
28 |
+ |
29 |
self.mydbapi[myroot] = fakedb |
30 |
def graph_tree(): |
31 |
pass |
32 |
|
33 |
Modified: main/trunk/pym/portage/dbapi/vartree.py |
34 |
=================================================================== |
35 |
--- main/trunk/pym/portage/dbapi/vartree.py 2008-06-25 09:00:23 UTC (rev 10781) |
36 |
+++ main/trunk/pym/portage/dbapi/vartree.py 2008-06-25 10:06:42 UTC (rev 10782) |
37 |
@@ -551,13 +551,19 @@ |
38 |
def checkblockers(self, origdep): |
39 |
pass |
40 |
|
41 |
+ def _clear_cache(self): |
42 |
+ self.mtdircache.clear() |
43 |
+ self.matchcache.clear() |
44 |
+ self.cpcache.clear() |
45 |
+ self._aux_cache_obj = None |
46 |
+ |
47 |
def _add(self, pkg_dblink): |
48 |
- self._clear_cache(pkg_dblink) |
49 |
+ self._clear_pkg_cache(pkg_dblink) |
50 |
|
51 |
def _remove(self, pkg_dblink): |
52 |
- self._clear_cache(pkg_dblink) |
53 |
+ self._clear_pkg_cache(pkg_dblink) |
54 |
|
55 |
- def _clear_cache(self, pkg_dblink): |
56 |
+ def _clear_pkg_cache(self, pkg_dblink): |
57 |
# Due to 1 second mtime granularity in <python-2.5, mtime checks |
58 |
# are not always sufficient to invalidate vardbapi caches. Therefore, |
59 |
# the caches need to be actively invalidated here. |
60 |
|
61 |
-- |
62 |
gentoo-commits@l.g.o mailing list |