wlav avatar wlav committed c38f9fe Merge

merge default into branch; now translates again ...

Comments (0)

Files changed (2)

rpython/memory/gc/env.py

 
 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 ----------
 

rpython/memory/gc/test/test_env.py

 """)
     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
+""")
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.