From 638ef457876c14b9d713e2fa991f5db3ad53c4f9 Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Wed, 3 Jun 2020 18:58:45 -0700 Subject: [PATCH] =?utf8?q?Don=E2=80=99t=20default=20to=20Valgrind=20unless?= =?utf8?q?=20ENABLE=5FCHECKING?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit * src/alloc.c (USE_VALGRIND): If not defined, don’t default it to 1 unless ENABLE_CHECKING. The Valgrind hooks bloat the garbage collector a bit in production, and there’s no need for them these days if one has a Valgrind suppressions file (which one needs anyway). (mark_maybe_pointer): Use ‘#if USE_VALGRIND’ instead of ‘#ifdef USE_VALGRIND’ for consistency with other uses of USE_VALGRIND. This is in case someone builds with ‘-DENABLE_CHECKING -DUSE_VALGRIND=0’ in CFLAGS. --- src/alloc.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/alloc.c b/src/alloc.c index 573bac00c84..f44f22be1a7 100644 --- a/src/alloc.c +++ b/src/alloc.c @@ -67,7 +67,8 @@ along with GNU Emacs. If not, see . */ # include #endif -#if defined HAVE_VALGRIND_VALGRIND_H && !defined USE_VALGRIND +#if (defined ENABLE_CHECKING \ + && defined HAVE_VALGRIND_VALGRIND_H && !defined USE_VALGRIND) # define USE_VALGRIND 1 #endif @@ -4694,7 +4695,7 @@ mark_maybe_pointer (void *p) { struct mem_node *m; -#ifdef USE_VALGRIND +#if USE_VALGRIND VALGRIND_MAKE_MEM_DEFINED (&p, sizeof (p)); #endif -- 2.39.5