[pypy-svn] pypy gc-minimark-largeobj: Fixing the test requires using an identity_dict instead of

arigo commits-noreply at bitbucket.org
Tue Jan 4 21:04:23 CET 2011


Author: Armin Rigo <arigo at tunes.org>
Branch: gc-minimark-largeobj
Changeset: r40399:21292ed45e7e
Date: 2011-01-04 21:02 +0100
http://bitbucket.org/pypy/pypy/changeset/21292ed45e7e/

Log:	Fixing the test requires using an identity_dict instead of a real
	dict here, because the hash of _objs changes.

diff --git a/pypy/rpython/memory/support.py b/pypy/rpython/memory/support.py
--- a/pypy/rpython/memory/support.py
+++ b/pypy/rpython/memory/support.py
@@ -2,6 +2,7 @@
 from pypy.rlib.objectmodel import free_non_gc_object, we_are_translated
 from pypy.rlib.rarithmetic import r_uint, LONG_BIT
 from pypy.rlib.debug import ll_assert
+from pypy.tool.identity_dict import identity_dict
 
 DEFAULT_CHUNK_SIZE = 1019
 
@@ -262,7 +263,7 @@
 class BasicAddressDict(object):
 
     def __init__(self):
-        self.data = {}
+        self.data = identity_dict()      # {_key(addr): value}
 
     def _key(self, addr):
         "NOT_RPYTHON: prebuilt AddressDicts are not supported"


More information about the Pypy-commit mailing list