aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2022-08-26 11:13:12 -0700
committerJunio C Hamano <gitster@pobox.com>2022-08-26 11:13:12 -0700
commit6283c1e6ad2b37be2ec2c312434ff5aebd899ba5 (patch)
treeca1cf5b7503727cff990dd5233b209b4962ef48b
parent58253043281202e1c17364382fb4388ae6be53a7 (diff)
parenta6a58f78015fd7f18e887a5e9682223a5b6408c8 (diff)
downloadgit-6283c1e6ad2b37be2ec2c312434ff5aebd899ba5.tar.gz
Merge branch 'pw/use-glibc-tunable-for-malloc-optim' into maint
Avoid repeatedly running getconf to ask libc version in the test suite, and instead just as it once per script. source: <pull.1311.git.1659620305757.gitgitgadget@gmail.com> * pw/use-glibc-tunable-for-malloc-optim: tests: cache glibc version check
-rw-r--r--t/test-lib.sh11
1 files changed, 8 insertions, 3 deletions
diff --git a/t/test-lib.sh b/t/test-lib.sh
index 8cabb4d10f..120f11812c 100644
--- a/t/test-lib.sh
+++ b/t/test-lib.sh
@@ -557,14 +557,19 @@ then
: nothing
}
else
+ _USE_GLIBC_TUNABLES=
+ if _GLIBC_VERSION=$(getconf GNU_LIBC_VERSION 2>/dev/null) &&
+ _GLIBC_VERSION=${_GLIBC_VERSION#"glibc "} &&
+ expr 2.34 \<= "$_GLIBC_VERSION" >/dev/null
+ then
+ _USE_GLIBC_TUNABLES=YesPlease
+ fi
setup_malloc_check () {
local g
local t
MALLOC_CHECK_=3 MALLOC_PERTURB_=165
export MALLOC_CHECK_ MALLOC_PERTURB_
- if _GLIBC_VERSION=$(getconf GNU_LIBC_VERSION 2>/dev/null) &&
- _GLIBC_VERSION=${_GLIBC_VERSION#"glibc "} &&
- expr 2.34 \<= "$_GLIBC_VERSION" >/dev/null
+ if test -n "$_USE_GLIBC_TUNABLES"
then
g=
LD_PRELOAD="libc_malloc_debug.so.0"