[pypy-svn] r68529 - in pypy/branch/gc-hash/pypy: rpython/lltypesystem rpython/memory/gctransform translator/c

arigo at codespeak.net arigo at codespeak.net
Fri Oct 16 12:15:43 CEST 2009


Author: arigo
Date: Fri Oct 16 12:15:42 2009
New Revision: 68529

Modified:
   pypy/branch/gc-hash/pypy/rpython/lltypesystem/lltype.py
   pypy/branch/gc-hash/pypy/rpython/memory/gctransform/refcounting.py
   pypy/branch/gc-hash/pypy/translator/c/gc.py
Log:
Fix test_standalone.py.


Modified: pypy/branch/gc-hash/pypy/rpython/lltypesystem/lltype.py
==============================================================================
--- pypy/branch/gc-hash/pypy/rpython/lltypesystem/lltype.py	(original)
+++ pypy/branch/gc-hash/pypy/rpython/lltypesystem/lltype.py	Fri Oct 16 12:15:42 2009
@@ -1862,6 +1862,12 @@
     assert p
     return p._identityhash()
 
+def identityhash_nocache(p):
+    """Version of identityhash() to use from backends that don't care about
+    caching."""
+    assert p
+    return p._identityhash(cache=False)
+
 def init_identity_hash(p, value):
     """For a prebuilt object p, initialize its hash value to 'value'."""
     assert isinstance(typeOf(p), Ptr)

Modified: pypy/branch/gc-hash/pypy/rpython/memory/gctransform/refcounting.py
==============================================================================
--- pypy/branch/gc-hash/pypy/rpython/memory/gctransform/refcounting.py	(original)
+++ pypy/branch/gc-hash/pypy/rpython/memory/gctransform/refcounting.py	Fri Oct 16 12:15:42 2009
@@ -194,7 +194,7 @@
             if not self.gcheaderbuilder.get_header(p):
                 hdr = self.gcheaderbuilder.new_header(p)
                 hdr.refcount = sys.maxint // 2
-                hdr.hash = lltype.identityhash(p)
+                hdr.hash = lltype.identityhash_nocache(p)
 
     def static_deallocation_funcptr_for_type(self, TYPE):
         if TYPE in self.static_deallocator_funcptrs:

Modified: pypy/branch/gc-hash/pypy/translator/c/gc.py
==============================================================================
--- pypy/branch/gc-hash/pypy/translator/c/gc.py	(original)
+++ pypy/branch/gc-hash/pypy/translator/c/gc.py	Fri Oct 16 12:15:42 2009
@@ -196,7 +196,7 @@
 
     def common_gcheader_initdata(self, defnode):
         if defnode.db.gctransformer is not None:
-            return [defnode.obj._as_ptr()._identityhash(cache=False)]
+            return [lltype.identityhash_nocache(defnode.obj._as_ptr())]
         else:
             return []
 



More information about the Pypy-commit mailing list