[pypy-svn] r47337 - pypy/dist/pypy/rpython/memory/gctransform

arigo at codespeak.net arigo at codespeak.net
Tue Oct 9 13:29:22 CEST 2007


Author: arigo
Date: Tue Oct  9 13:29:22 2007
New Revision: 47337

Modified:
   pypy/dist/pypy/rpython/memory/gctransform/framework.py
Log:
This change broke various tests.  For testing, let the transformer subclass
still override the GCClass and GC_PARAMS explicitly.


Modified: pypy/dist/pypy/rpython/memory/gctransform/framework.py
==============================================================================
--- pypy/dist/pypy/rpython/memory/gctransform/framework.py	(original)
+++ pypy/dist/pypy/rpython/memory/gctransform/framework.py	Tue Oct  9 13:29:22 2007
@@ -36,7 +36,15 @@
         from pypy.rpython.memory.gc import choose_gc_from_config
         super(FrameworkGCTransformer, self).__init__(translator, inline=True)
         AddressLinkedList = get_address_linked_list()
-        GCClass, GC_PARAMS = choose_gc_from_config(translator.config)
+        if hasattr(self, 'GC_PARAMS'):
+            # for tests: the GC choice can be specified as class attributes
+            from pypy.rpython.memory.gc import MarkSweepGC
+            GCClass = getattr(self, 'GCClass', MarkSweepGC)
+            GC_PARAMS = self.GC_PARAMS
+        else:
+            # for regular translation: pick the GC from the config
+            GCClass, GC_PARAMS = choose_gc_from_config(translator.config)
+
         self.FINALIZERTYPE = lltype.Ptr(ADDRESS_VOID_FUNC)
         class GCData(object):
             # types of the GC information tables



More information about the Pypy-commit mailing list