Author: Armin Rigo <[email protected]>
Branch: 
Changeset: r89762:64e22023ba60
Date: 2017-01-25 12:30 +0100
http://bitbucket.org/pypy/pypy/changeset/64e22023ba60/

Log:    A comment, and another cache that could be cleared

diff --git a/pypy/objspace/std/mapdict.py b/pypy/objspace/std/mapdict.py
--- a/pypy/objspace/std/mapdict.py
+++ b/pypy/objspace/std/mapdict.py
@@ -436,6 +436,9 @@
         for i in range(len(self.cached_attrs)):
             self.cached_attrs[i] = None
 
+    def _cleanup_(self):
+        self.clear()
+
 # ____________________________________________________________
 # object implementation
 
diff --git a/pypy/objspace/std/typeobject.py b/pypy/objspace/std/typeobject.py
--- a/pypy/objspace/std/typeobject.py
+++ b/pypy/objspace/std/typeobject.py
@@ -71,6 +71,10 @@
 class MethodCache(object):
 
     def __init__(self, space):
+        # Note: these attributes never change which object they contain,
+        # so reading 'cache.versions' for example is constant-folded.
+        # The actual list in 'cache.versions' is not a constant, of
+        # course.
         SIZE = 1 << space.config.objspace.std.methodcachesizeexp
         self.versions = [None] * SIZE
         self.names = [None] * SIZE
_______________________________________________
pypy-commit mailing list
[email protected]
https://mail.python.org/mailman/listinfo/pypy-commit

Reply via email to