aboutsummaryrefslogtreecommitdiffstats
path: root/src/buffer.c
diff options
context:
space:
mode:
authorPhilipp Stephani2020-08-01 14:13:55 +0200
committerPhilipp Stephani2020-08-01 14:16:22 +0200
commitc3b53559965a4c6f48274c3cbcb43eb6ef23ae14 (patch)
tree6fe3d9675b91957a8062efd2a4f8c593ac3eec09 /src/buffer.c
parent89127266c93083521d71d8f2314ac88905163fd8 (diff)
downloademacs-c3b53559965a4c6f48274c3cbcb43eb6ef23ae14.tar.gz
emacs-c3b53559965a4c6f48274c3cbcb43eb6ef23ae14.zip
Suppress leak detector in some cases
We intentionally leak some objects. Prevent the ASan leak detector from raising false alarms in these cases. * configure.ac: Search for lsan_interface.h header. * src/data.c (make_blv): Allow leaking of buffer-local values. * src/buffer.c (enlarge_buffer_text): Allow leaking of buffer text. * src/emacs-module.c (Fmodule_load, initialize_environment): Allow intentional leak of runtime and environment objects if module assertions are enabled.
Diffstat (limited to 'src/buffer.c')
-rw-r--r--src/buffer.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/buffer.c b/src/buffer.c
index f1cb4d50414..3456a46be3e 100644
--- a/src/buffer.c
+++ b/src/buffer.c
@@ -28,6 +28,10 @@ along with GNU Emacs. If not, see <https://www.gnu.org/licenses/>. */
28#include <stdlib.h> 28#include <stdlib.h>
29#include <unistd.h> 29#include <unistd.h>
30 30
31#ifdef HAVE_SANITIZER_LSAN_INTERFACE_H
32#include <sanitizer/lsan_interface.h>
33#endif
34
31#include <verify.h> 35#include <verify.h>
32 36
33#include "lisp.h" 37#include "lisp.h"
@@ -5083,6 +5087,9 @@ enlarge_buffer_text (struct buffer *b, ptrdiff_t delta)
5083#else 5087#else
5084 p = xrealloc (b->text->beg, new_nbytes); 5088 p = xrealloc (b->text->beg, new_nbytes);
5085#endif 5089#endif
5090#ifdef HAVE_SANITIZER_LSAN_INTERFACE_H
5091 __lsan_ignore_object (p);
5092#endif
5086 5093
5087 if (p == NULL) 5094 if (p == NULL)
5088 { 5095 {