[pypy-commit] pypy stmgc-c8: Forgot that arrays can also be 'stm_dont_track_raw_accesses'

arigo noreply at buildbot.pypy.org
Wed Jun 24 09:57:33 CEST 2015


Author: Armin Rigo <arigo at tunes.org>
Branch: stmgc-c8
Changeset: r78280:8d2fbff1bf9e
Date: 2015-06-24 09:41 +0200
http://bitbucket.org/pypy/pypy/changeset/8d2fbff1bf9e/

Log:	Forgot that arrays can also be 'stm_dont_track_raw_accesses'

diff --git a/pypy/module/pypystm/unsafe_op.py b/pypy/module/pypystm/unsafe_op.py
--- a/pypy/module/pypystm/unsafe_op.py
+++ b/pypy/module/pypystm/unsafe_op.py
@@ -7,9 +7,9 @@
 
 @specialize.memo()
 def get_unsafe_type_ptr(TP):
-    UNSAFE = lltype.Struct('UNSAFE', ('x', TP),
-                           hints = {'stm_dont_track_raw_accesses': True})
-    return rffi.CArrayPtr(UNSAFE)
+    UNSAFE = lltype.Array(TP, hints={'nolength': True,
+                                     'stm_dont_track_raw_accesses': True})
+    return lltype.Ptr(UNSAFE)
 
 
 def unsafe_write_raw_signed_data(w_cdata, index, source, size):
@@ -17,7 +17,7 @@
         for TP, _ in misc._prim_signed_types:
             if size == rffi.sizeof(TP):
                 TPP = get_unsafe_type_ptr(TP)
-                rffi.cast(TPP, target)[index].x = rffi.cast(TP, source)
+                rffi.cast(TPP, target)[index] = rffi.cast(TP, source)
                 return
     raise NotImplementedError("bad integer size")
 
@@ -26,7 +26,7 @@
         for TP, _ in misc._prim_unsigned_types:
             if size == rffi.sizeof(TP):
                 TPP = get_unsafe_type_ptr(TP)
-                rffi.cast(TPP, target)[index].x = rffi.cast(TP, source)
+                rffi.cast(TPP, target)[index] = rffi.cast(TP, source)
                 return
     raise NotImplementedError("bad integer size")
 
@@ -35,7 +35,7 @@
         for TP, _ in misc._prim_float_types:
             if size == rffi.sizeof(TP):
                 TPP = get_unsafe_type_ptr(TP)
-                rffi.cast(TPP, target)[index].x = rffi.cast(TP, source)
+                rffi.cast(TPP, target)[index] = rffi.cast(TP, source)
                 return
     raise NotImplementedError("bad float size")
 


More information about the pypy-commit mailing list