aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlex Hirsch <w4rh4wk@bluephoenix.at>2018-02-12 00:14:26 +0100
committerJussi Pakkanen <jpakkane@gmail.com>2018-02-12 21:39:28 +0200
commit3e8eab66a1d2e4efe0178e3460ad8a96945fe9ed (patch)
treef0ccae9a5ca0cf0624fd9da715ddbec937dc19ec
parent262eeb7e9ee48ecc3ab7789f479f53cdc42037b5 (diff)
downloadmeson-3e8eab66a1d2e4efe0178e3460ad8a96945fe9ed.zip
meson-3e8eab66a1d2e4efe0178e3460ad8a96945fe9ed.tar.gz
meson-3e8eab66a1d2e4efe0178e3460ad8a96945fe9ed.tar.bz2
Do not set MALLOC_PERTURB_ for benchmarks
Setting MALLOC_PERTURB_ to a non-zero value is fine for regular test cases. It helps catching bugs, but also comes with some runtime overhead. This overhead is noticeable for benchmarks when compared to running them directly instead of through Meason. Therefore, MALLOC_PERTURB_ is not touched for benchmarks. closes #3034
-rw-r--r--mesonbuild/mtest.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/mesonbuild/mtest.py b/mesonbuild/mtest.py
index 95e532c..a697106 100644
--- a/mesonbuild/mtest.py
+++ b/mesonbuild/mtest.py
@@ -228,10 +228,10 @@ class TestHarness:
# If MALLOC_PERTURB_ is not set, or if it is set to an empty value,
# (i.e., the test or the environment don't explicitly set it), set
- # it ourselves. We do this unconditionally because it is extremely
- # useful to have in tests.
+ # it ourselves. We do this unconditionally for regular tests
+ # because it is extremely useful to have.
# Setting MALLOC_PERTURB_="0" will completely disable this feature.
- if 'MALLOC_PERTURB_' not in child_env or not child_env['MALLOC_PERTURB_']:
+ if ('MALLOC_PERTURB_' not in child_env or not child_env['MALLOC_PERTURB_']) and not self.options.benchmark:
child_env['MALLOC_PERTURB_'] = str(random.randint(1, 255))
setsid = None