[pypy-commit] pypy reflex-support: merge default into branch; now translates again ...

wlav noreply at buildbot.pypy.org
Thu Apr 18 23:37:39 CEST 2013


Author: Wim Lavrijsen <WLavrijsen at lbl.gov>
Branch: reflex-support
Changeset: r63493:c38f9fe83a3a
Date: 2013-04-18 14:13 -0700
http://bitbucket.org/pypy/pypy/changeset/c38f9fe83a3a/

Log:	merge default into branch; now translates again ...

diff --git a/rpython/memory/gc/env.py b/rpython/memory/gc/env.py
--- a/rpython/memory/gc/env.py
+++ b/rpython/memory/gc/env.py
@@ -207,15 +207,8 @@
 
 def _detect_arm_cpu(data):
     # check for the presence of a 'Processor' entry
-    start = _findend(data, 'Processor', 0)
-    if start >= 0:
-        # *** data[start:linepos] == "   : ARMv6-compatible processor rev 7\n"
-        start = _skipspace(data, start)
-        if data[start] == ':':
-            # *** data[start:linepos] == ": ARMv6-compatible processor rev 7\n"
-            start = _skipspace(data, start + 1)
-            return data[start], data[start + 1], data[start + 2] == 'A','R','M'
-    return False
+    p = _findend(data, 'Processor', 0)
+    return p >= 0 and _findend(data, 'ARMv', p) > 0
 
 # ---------- Darwin ----------
 
diff --git a/rpython/memory/gc/test/test_env.py b/rpython/memory/gc/test/test_env.py
--- a/rpython/memory/gc/test/test_env.py
+++ b/rpython/memory/gc/test/test_env.py
@@ -172,3 +172,12 @@
 """)
     result = env.get_L2cache_linux2(str(filepath))
     assert result == -1
+
+def test__detect_arm():
+    assert env._detect_arm_cpu("Processor       : ARMv6-compatible processor rev 7 (v6l)")
+    assert not env._detect_arm_cpu("""\
+processor   : 0
+vendor_id   : GenuineIntel
+cpu family  : 6
+model       : 37
+""")


More information about the pypy-commit mailing list