]> git.eshelyaron.com Git - emacs.git/commitdiff
Don’t default to Valgrind unless ENABLE_CHECKING
authorPaul Eggert <eggert@cs.ucla.edu>
Thu, 4 Jun 2020 01:58:45 +0000 (18:58 -0700)
committerPaul Eggert <eggert@cs.ucla.edu>
Thu, 4 Jun 2020 02:00:04 +0000 (19:00 -0700)
* 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

index 573bac00c845f073dcde2a7e86edcf6d95e4e634..f44f22be1a769d3724037f12229d8166e95141f1 100644 (file)
@@ -67,7 +67,8 @@ along with GNU Emacs.  If not, see <https://www.gnu.org/licenses/>.  */
 # include <malloc.h>
 #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