[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] trunk r114432: Tell valgrind about conservative GC regions
From: |
Daniel Colascione |
Subject: |
[Emacs-diffs] trunk r114432: Tell valgrind about conservative GC regions and suppress spurious |
Date: |
Mon, 23 Sep 2013 02:37:00 +0000 |
User-agent: |
Bazaar (2.6b2) |
------------------------------------------------------------
revno: 114432
revision-id: address@hidden
parent: address@hidden
committer: Daniel Colascione <address@hidden>
branch nick: trunk
timestamp: Sun 2013-09-22 18:34:52 -0800
message:
Tell valgrind about conservative GC regions and suppress spurious
warings.
* alloc.c (USE_VALGRIND): New macro; on by default
when ENABLE_CHECKING.
(mark_maybe_object,mark_maybe_pointer)
[USE_VALGRIND]: Mark conservatively-scanned regions valid for
valgrind purposes.
(valgrind_p) [USE_VALGRIND]: New variable.
(init_alloc) [USE_VALGRIND]: Initialize valgrind_p.
modified:
ChangeLog changelog-20091113204419-o5vbwnq5f7feedwu-1538
configure.ac
configure.in-20091113204419-o5vbwnq5f7feedwu-783
src/ChangeLog changelog-20091113204419-o5vbwnq5f7feedwu-1438
src/alloc.c alloc.c-20091113204419-o5vbwnq5f7feedwu-252
=== modified file 'ChangeLog'
--- a/ChangeLog 2013-09-20 09:19:56 +0000
+++ b/ChangeLog 2013-09-23 02:34:52 +0000
@@ -1,3 +1,7 @@
+2013-09-23 Daniel Colascione <address@hidden>
+
+ * configure.ac: Check for valgrind headers.
+
2013-09-20 Xue Fuqiao <address@hidden>
* INSTALL: New homepage of libtiff.
=== modified file 'configure.ac'
--- a/configure.ac 2013-09-20 03:41:37 +0000
+++ b/configure.ac 2013-09-23 02:34:52 +0000
@@ -3696,6 +3696,8 @@
AC_SUBST(DESLIB)
AC_SUBST(KRB4LIB)
+AC_CHECK_HEADERS(valgrind/valgrind.h)
+
AC_CHECK_FUNCS_ONCE(tzset)
AC_MSG_CHECKING(whether localtime caches TZ)
AC_CACHE_VAL(emacs_cv_localtime_cache,
=== modified file 'src/ChangeLog'
--- a/src/ChangeLog 2013-09-22 14:26:10 +0000
+++ b/src/ChangeLog 2013-09-23 02:34:52 +0000
@@ -1,3 +1,13 @@
+2013-09-23 Daniel Colascione <address@hidden>
+
+ * alloc.c (USE_VALGRIND): New macro; on by default
+ when ENABLE_CHECKING.
+ (mark_maybe_object,mark_maybe_pointer)
+ [USE_VALGRIND]: Mark conservatively-scanned regions valid for
+ valgrind purposes.
+ (valgrind_p) [USE_VALGRIND]: New variable.
+ (init_alloc) [USE_VALGRIND]: Initialize valgrind_p.
+
2013-09-22 Jan Djärv <address@hidden>
* process.c (wait_reading_process_output): Change int pnamelen to
=== modified file 'src/alloc.c'
--- a/src/alloc.c 2013-09-22 09:31:55 +0000
+++ b/src/alloc.c 2013-09-23 02:34:52 +0000
@@ -45,6 +45,18 @@
#include <verify.h>
+#if (defined ENABLE_CHECKING && \
+ defined HAVE_VALGRIND_VALGRIND_H && \
+ !defined USE_VALGRIND)
+# define USE_VALGRIND 1
+#endif
+
+#if USE_VALGRIND
+#include <valgrind/valgrind.h>
+#include <valgrind/memcheck.h>
+static int valgrind_p;
+#endif
+
/* GC_CHECK_MARKED_OBJECTS means do sanity checks on allocated objects.
Doable only if GC_MARK_STACK. */
#if ! GC_MARK_STACK
@@ -4327,6 +4339,11 @@
void *po;
struct mem_node *m;
+#if USE_VALGRIND
+ if (valgrind_p)
+ VALGRIND_MAKE_MEM_DEFINED (&obj, sizeof (obj));
+#endif
+
if (INTEGERP (obj))
return;
@@ -4395,6 +4412,11 @@
{
struct mem_node *m;
+#if USE_VALGRIND
+ if (valgrind_p)
+ VALGRIND_MAKE_MEM_DEFINED (&p, sizeof (p));
+#endif
+
/* Quickly rule out some values which can't point to Lisp data.
USE_LSB_TAG needs Lisp data to be aligned on multiples of GCALIGNMENT.
Otherwise, assume that Lisp data is aligned on even addresses. */
@@ -6643,6 +6665,10 @@
#endif
Vgc_elapsed = make_float (0.0);
gcs_done = 0;
+
+#if USE_VALGRIND
+ valgrind_p = RUNNING_ON_VALGRIND;
+#endif
}
void
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Emacs-diffs] trunk r114432: Tell valgrind about conservative GC regions and suppress spurious,
Daniel Colascione <=