diff options
| author | Paul Eggert | 2014-01-20 08:47:41 -0800 |
|---|---|---|
| committer | Paul Eggert | 2014-01-20 08:47:41 -0800 |
| commit | 3c35702fe921254340ad949ce3cab0b668788c90 (patch) | |
| tree | 9de0bfd95d2dda97dd29d96faf9dfc7bdeb9a4cd /src | |
| parent | 71f16bdad487018608007b53d26eb65b4cbe6b55 (diff) | |
| download | emacs-3c35702fe921254340ad949ce3cab0b668788c90.tar.gz emacs-3c35702fe921254340ad949ce3cab0b668788c90.zip | |
Pacify valgrind by initializing buffer redisplay bit.
Problem reported by Dmitry Antipov in
<http://lists.gnu.org/archive/html/emacs-devel/2014-01/msg01756.html>.
* alloc.c (USE_VALGRIND): Move this to ...
* conf_post.h (USE_VALGRIND): ... here. Use booleans.
* buffer.c (Fget_buffer_create): Initialize redisplay bit
to pacify valgrind.
Diffstat (limited to 'src')
| -rw-r--r-- | src/ChangeLog | 8 | ||||
| -rw-r--r-- | src/alloc.c | 6 | ||||
| -rw-r--r-- | src/buffer.c | 4 | ||||
| -rw-r--r-- | src/conf_post.h | 9 |
4 files changed, 20 insertions, 7 deletions
diff --git a/src/ChangeLog b/src/ChangeLog index 87b84e00918..3ac22572d2f 100644 --- a/src/ChangeLog +++ b/src/ChangeLog | |||
| @@ -1,5 +1,13 @@ | |||
| 1 | 2014-01-20 Paul Eggert <eggert@cs.ucla.edu> | 1 | 2014-01-20 Paul Eggert <eggert@cs.ucla.edu> |
| 2 | 2 | ||
| 3 | Pacify valgrind by initializing buffer redisplay bit. | ||
| 4 | Problem reported by Dmitry Antipov in | ||
| 5 | <http://lists.gnu.org/archive/html/emacs-devel/2014-01/msg01756.html>. | ||
| 6 | * alloc.c (USE_VALGRIND): Move this to ... | ||
| 7 | * conf_post.h (USE_VALGRIND): ... here. Use booleans. | ||
| 8 | * buffer.c (Fget_buffer_create): Initialize redisplay bit | ||
| 9 | to pacify valgrind. | ||
| 10 | |||
| 3 | Revert some of the CANNOT_DUMP fix (Bug#16494). | 11 | Revert some of the CANNOT_DUMP fix (Bug#16494). |
| 4 | * lread.c (init_lread): Fix typo: NILP, not !NILP. | 12 | * lread.c (init_lread): Fix typo: NILP, not !NILP. |
| 5 | 13 | ||
diff --git a/src/alloc.c b/src/alloc.c index 7f0a74ca834..d31cf3b7193 100644 --- a/src/alloc.c +++ b/src/alloc.c | |||
| @@ -48,12 +48,6 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */ | |||
| 48 | 48 | ||
| 49 | #include <verify.h> | 49 | #include <verify.h> |
| 50 | 50 | ||
| 51 | #if (defined ENABLE_CHECKING \ | ||
| 52 | && defined HAVE_VALGRIND_VALGRIND_H \ | ||
| 53 | && !defined USE_VALGRIND) | ||
| 54 | # define USE_VALGRIND 1 | ||
| 55 | #endif | ||
| 56 | |||
| 57 | #if USE_VALGRIND | 51 | #if USE_VALGRIND |
| 58 | #include <valgrind/valgrind.h> | 52 | #include <valgrind/valgrind.h> |
| 59 | #include <valgrind/memcheck.h> | 53 | #include <valgrind/memcheck.h> |
diff --git a/src/buffer.c b/src/buffer.c index c48610d6578..87405174ad2 100644 --- a/src/buffer.c +++ b/src/buffer.c | |||
| @@ -573,7 +573,9 @@ even if it is dead. The return value is never nil. */) | |||
| 573 | BUF_END_UNCHANGED (b) = 0; | 573 | BUF_END_UNCHANGED (b) = 0; |
| 574 | BUF_BEG_UNCHANGED (b) = 0; | 574 | BUF_BEG_UNCHANGED (b) = 0; |
| 575 | *(BUF_GPT_ADDR (b)) = *(BUF_Z_ADDR (b)) = 0; /* Put an anchor '\0'. */ | 575 | *(BUF_GPT_ADDR (b)) = *(BUF_Z_ADDR (b)) = 0; /* Put an anchor '\0'. */ |
| 576 | b->text->inhibit_shrinking = 0; | 576 | b->text->inhibit_shrinking = false; |
| 577 | if (USE_VALGRIND) | ||
| 578 | b->text->redisplay = false; | ||
| 577 | 579 | ||
| 578 | b->newline_cache = 0; | 580 | b->newline_cache = 0; |
| 579 | b->width_run_cache = 0; | 581 | b->width_run_cache = 0; |
diff --git a/src/conf_post.h b/src/conf_post.h index 7419b53c5df..cdb2f973c2b 100644 --- a/src/conf_post.h +++ b/src/conf_post.h | |||
| @@ -65,6 +65,15 @@ typedef bool bool_bf; | |||
| 65 | # define ADDRESS_SANITIZER false | 65 | # define ADDRESS_SANITIZER false |
| 66 | #endif | 66 | #endif |
| 67 | 67 | ||
| 68 | /* True if Emacs might be run under valgrind. */ | ||
| 69 | #ifndef USE_VALGRIND | ||
| 70 | # if defined ENABLE_CHECKING && defined HAVE_VALGRIND_VALGRIND_H | ||
| 71 | # define USE_VALGRIND true | ||
| 72 | # else | ||
| 73 | # define USE_VALGRIND false | ||
| 74 | # endif | ||
| 75 | #endif | ||
| 76 | |||
| 68 | #ifdef DARWIN_OS | 77 | #ifdef DARWIN_OS |
| 69 | #ifdef emacs | 78 | #ifdef emacs |
| 70 | #define malloc unexec_malloc | 79 | #define malloc unexec_malloc |