[pypy-commit] pypy stmgc-c8: translation fix

arigo noreply at buildbot.pypy.org
Sun Jun 21 23:25:47 CEST 2015


Author: Armin Rigo <arigo at tunes.org>
Branch: stmgc-c8
Changeset: r78238:7260a61ff88a
Date: 2015-06-21 22:27 +0100
http://bitbucket.org/pypy/pypy/changeset/7260a61ff88a/

Log:	translation fix

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
@@ -1,13 +1,18 @@
 from pypy.interpreter.gateway import unwrap_spec
 from pypy.module._cffi_backend import cdataobj
 from rpython.rlib.rstm import stm_ignored
+from rpython.rlib.jit import dont_look_inside
 from rpython.rtyper.lltypesystem import rffi
 
 
+ at dont_look_inside
+def unsafe_write(ptr, value):
+    with stm_ignored:
+        ptr[0] = value
+
 @unwrap_spec(w_cdata=cdataobj.W_CData, index=int, value='c_int')
 def unsafe_write_int32(space, w_cdata, index, value):
     with w_cdata as ptr:
         ptr = rffi.cast(rffi.INTP, rffi.ptradd(ptr, index * 4))
         value = rffi.cast(rffi.INT, value)
-        with stm_ignored:
-            ptr[0] = value
+        unsafe_write(ptr, value)


More information about the pypy-commit mailing list