[pypy-svn] r77599 - pypy/branch/32ptr-on-64bit/pypy/rpython/memory/gc

arigo at codespeak.net arigo at codespeak.net
Tue Oct 5 14:09:29 CEST 2010


Author: arigo
Date: Tue Oct  5 14:09:28 2010
New Revision: 77599

Modified:
   pypy/branch/32ptr-on-64bit/pypy/rpython/memory/gc/minimark.py
Log:
In case of compressptr, complain (crash with FixedSizeObjectTooLarge) if
allocating a fixed-size object that is too large to fit in the
ArenaCollection.  The default limit should probably be increased quite a
bit.


Modified: pypy/branch/32ptr-on-64bit/pypy/rpython/memory/gc/minimark.py
==============================================================================
--- pypy/branch/32ptr-on-64bit/pypy/rpython/memory/gc/minimark.py	(original)
+++ pypy/branch/32ptr-on-64bit/pypy/rpython/memory/gc/minimark.py	Tue Oct  5 14:09:28 2010
@@ -514,6 +514,11 @@
                 cardheadersize = 0
                 extra_flags = 0
                 #
+                # We get here for large fixed-size objects.  Complain if
+                # self.config.compressptr is set.
+                if self.config.compressptr and not self.is_varsize(typeid):
+                    raise FixedSizeObjectTooLarge
+                #
             else:
                 # Reserve N extra words containing card bits before the object.
                 extra_words = self.card_marking_words_for_length(length)
@@ -1564,3 +1569,7 @@
             else:
                 self.all_objects.append((rawobj, nsize))
                 self.total_memory_used += nsize
+
+
+class FixedSizeObjectTooLarge(Exception):
+    pass



More information about the Pypy-commit mailing list