diff options
| author | Paul Eggert | 2020-06-03 18:58:45 -0700 |
|---|---|---|
| committer | Paul Eggert | 2020-06-03 19:00:04 -0700 |
| commit | 638ef457876c14b9d713e2fa991f5db3ad53c4f9 (patch) | |
| tree | 29d98738fba3a107a1916918c2892ac04d65eaeb | |
| parent | 65749436d03fd0b9e379dcc06cc678522c6960cf (diff) | |
| download | emacs-638ef457876c14b9d713e2fa991f5db3ad53c4f9.tar.gz emacs-638ef457876c14b9d713e2fa991f5db3ad53c4f9.zip | |
Don’t default to Valgrind unless ENABLE_CHECKING
* 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.
| -rw-r--r-- | src/alloc.c | 5 |
1 files 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 <https://www.gnu.org/licenses/>. */ | |||
| 67 | # include <malloc.h> | 67 | # include <malloc.h> |
| 68 | #endif | 68 | #endif |
| 69 | 69 | ||
| 70 | #if defined HAVE_VALGRIND_VALGRIND_H && !defined USE_VALGRIND | 70 | #if (defined ENABLE_CHECKING \ |
| 71 | && defined HAVE_VALGRIND_VALGRIND_H && !defined USE_VALGRIND) | ||
| 71 | # define USE_VALGRIND 1 | 72 | # define USE_VALGRIND 1 |
| 72 | #endif | 73 | #endif |
| 73 | 74 | ||
| @@ -4694,7 +4695,7 @@ mark_maybe_pointer (void *p) | |||
| 4694 | { | 4695 | { |
| 4695 | struct mem_node *m; | 4696 | struct mem_node *m; |
| 4696 | 4697 | ||
| 4697 | #ifdef USE_VALGRIND | 4698 | #if USE_VALGRIND |
| 4698 | VALGRIND_MAKE_MEM_DEFINED (&p, sizeof (p)); | 4699 | VALGRIND_MAKE_MEM_DEFINED (&p, sizeof (p)); |
| 4699 | #endif | 4700 | #endif |
| 4700 | 4701 | ||