[pypy-svn] r77901 - in pypy/branch/32ptr-on-64bit/pypy/rpython: lltypesystem test
arigo at codespeak.net
arigo at codespeak.net
Thu Oct 14 11:35:56 CEST 2010
Author: arigo
Date: Thu Oct 14 11:35:54 2010
New Revision: 77901
Modified:
pypy/branch/32ptr-on-64bit/pypy/rpython/lltypesystem/rcompressed.py
pypy/branch/32ptr-on-64bit/pypy/rpython/test/test_rcompressed.py
Log:
Test and fix: GCREF may point to a var-sized object, so it cannot be compressed.
Modified: pypy/branch/32ptr-on-64bit/pypy/rpython/lltypesystem/rcompressed.py
==============================================================================
--- pypy/branch/32ptr-on-64bit/pypy/rpython/lltypesystem/rcompressed.py (original)
+++ pypy/branch/32ptr-on-64bit/pypy/rpython/lltypesystem/rcompressed.py Thu Oct 14 11:35:54 2010
@@ -14,6 +14,8 @@
# mmap()-within-32GB-of-RAM.
if baserepr.lowleveltype.TO._is_varsize():
return baserepr
+ if baserepr.lowleveltype == llmemory.GCREF:
+ return baserepr # a GCREF may contain a non-fixed-size object
try:
comprmgr = rtyper.compressed_gcref_manager
except AttributeError:
Modified: pypy/branch/32ptr-on-64bit/pypy/rpython/test/test_rcompressed.py
==============================================================================
--- pypy/branch/32ptr-on-64bit/pypy/rpython/test/test_rcompressed.py (original)
+++ pypy/branch/32ptr-on-64bit/pypy/rpython/test/test_rcompressed.py Thu Oct 14 11:35:54 2010
@@ -167,6 +167,12 @@
assert er is r_L
assert ir.lowleveltype == llmemory.HiddenGcRef32
+ def test_rerased(self):
+ from pypy.rlib.rerased import ErasedRepr
+ r_E = ErasedRepr(self.rtyper)
+ er, ir = rmodel.externalvsinternal(self. rtyper, r_E)
+ assert er is ir is r_E
+
class TestLLtype64(MixinCompressed64, test_rclass.TestLLtype):
More information about the Pypy-commit
mailing list