[pypy-commit] pypy default: Avoid calling os.uname() at runtime. Not completely sure this plays
arigo
noreply at buildbot.pypy.org
Sat Aug 10 13:35:52 CEST 2013
Author: Armin Rigo <arigo at tunes.org>
Branch:
Changeset: r66058:ab7580454b32
Date: 2013-08-10 13:35 +0200
http://bitbucket.org/pypy/pypy/changeset/ab7580454b32/
Log: Avoid calling os.uname() at runtime. Not completely sure this plays
nice with cross-compilation. How can I check?...
Also, a fix for builds on linux3 on some Python versions.
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
@@ -131,8 +131,13 @@
# ---------- Linux2 ----------
+try:
+ ARCH = os.uname()[4] # machine
+except (OSError, AttributeError):
+ ARCH = ''
+
def get_L2cache_linux2():
- arch = os.uname()[4] # machine
+ arch = ARCH # precomputed; the call to os.uname() is not translated
if arch.endswith('86') or arch == 'x86_64':
return get_L2cache_linux2_cpuinfo()
if arch in ('alpha', 'ppc', 'ppc64'):
@@ -145,6 +150,8 @@
return get_L2cache_linux2_sparc()
return -1
+get_L2cache_linux3 = get_L2cache_linux2
+
def get_L2cache_linux2_cpuinfo(filename="/proc/cpuinfo", label='cache size'):
debug_start("gc-hardware")
More information about the pypy-commit
mailing list