Author: Armin Rigo <[email protected]>
Branch: stm-gc
Changeset: r52386:2f35eac5d08b
Date: 2012-02-12 11:44 +0100
http://bitbucket.org/pypy/pypy/changeset/2f35eac5d08b/

Log:    Fixes

diff --git a/pypy/rpython/memory/gc/stmgc.py b/pypy/rpython/memory/gc/stmgc.py
--- a/pypy/rpython/memory/gc/stmgc.py
+++ b/pypy/rpython/memory/gc/stmgc.py
@@ -82,7 +82,7 @@
         """Called at run-time to initialize the GC."""
         GCBase.setup(self)
         self.stm_operations.setup_size_getter(
-                llhelper(GETSIZE, self._getsize_fn))
+                llhelper(self.stm_operations.GETSIZE, self._getsize_fn))
         self.main_thread_tls = self.setup_thread(True)
         self.mutex_lock = ll_thread.allocate_ll_lock()
 
@@ -489,6 +489,7 @@
         tls.pending_list = NULL
         # Enumerate the roots, which are the local copies of global objects.
         # For each root, trace it.
+        CALLBACK = self.stm_operations.CALLBACK_ENUM
         callback = llhelper(CALLBACK, self._enum_entries)
         # xxx hack hack hack!  Stores 'self' in a global place... but it's
         # pointless after translation because 'self' is a Void.
diff --git a/pypy/rpython/memory/gc/test/test_stmgc.py 
b/pypy/rpython/memory/gc/test/test_stmgc.py
--- a/pypy/rpython/memory/gc/test/test_stmgc.py
+++ b/pypy/rpython/memory/gc/test/test_stmgc.py
@@ -1,6 +1,6 @@
 import py
 from pypy.rpython.lltypesystem import lltype, llmemory, llarena, rffi
-from pypy.rpython.memory.gc.stmgc import StmGC, PRIMITIVE_SIZES, WORD, CALLBACK
+from pypy.rpython.memory.gc.stmgc import StmGC, WORD
 from pypy.rpython.memory.gc.stmgc import GCFLAG_GLOBAL, GCFLAG_WAS_COPIED
 from pypy.rpython.memory.support import mangle_hash
 
@@ -22,6 +22,12 @@
     # any use of 'self._gc' is wrong here: it's stmgc.py that should call
     # et.c, and not the other way around.
 
+    PRIMITIVE_SIZES = {1: lltype.Char,
+                       WORD: lltype.Signed}
+    CALLBACK_ENUM = lltype.Ptr(lltype.FuncType([llmemory.Address] * 3,
+                                               lltype.Void))
+    GETSIZE  = lltype.Ptr(lltype.FuncType([llmemory.Address], lltype.Signed))
+
     threadnum = 0          # 0 = main thread; 1,2,3... = transactional threads
 
     def setup_size_getter(self, getsize_fn):
@@ -65,7 +71,7 @@
         tldict[obj] = localobj
 
     def tldict_enum(self, callback):
-        assert lltype.typeOf(callback) == CALLBACK
+        assert lltype.typeOf(callback) == self.CALLBACK_ENUM
         tls = self.get_tls()
         for key, value in self._tldicts[self.threadnum].iteritems():
             callback(tls, key, value)
_______________________________________________
pypy-commit mailing list
[email protected]
http://mail.python.org/mailman/listinfo/pypy-commit

Reply via email to