emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] /srv/bzr/emacs/emacs-24 r107990: * alloc.c: Handle unusual


From: Paul Eggert
Subject: [Emacs-diffs] /srv/bzr/emacs/emacs-24 r107990: * alloc.c: Handle unusual debugging option combinations.
Date: Fri, 02 Nov 2012 02:26:00 -0000
User-agent: Bazaar (2.5.0)

------------------------------------------------------------
revno: 107990
committer: Paul Eggert <address@hidden>
branch nick: trunk
timestamp: Sun 2012-04-22 00:41:30 -0700
message:
  * alloc.c: Handle unusual debugging option combinations.
  
  (GC_CHECK_MARKED_OBJECTS): Undef if ! GC_MARK_STACK,
  since the two debugging options are incompatible.
  (GC_MALLOC_CHECK): Similarly, undef if GC_CHECK_MARKED_OBJECTS
  is defined.
  (mem_init, mem_insert, mem_insert_fixup):
  Define if GC_MARK_STACK || GC_MALLOC_CHECK.
  (NEED_MEM_INSERT): Remove; no longer needed.
modified:
  src/ChangeLog
  src/alloc.c
=== modified file 'src/ChangeLog'
--- a/src/ChangeLog     2012-04-22 02:58:23 +0000
+++ b/src/ChangeLog     2012-04-22 07:41:30 +0000
@@ -1,3 +1,14 @@
+2012-04-22  Paul Eggert  <address@hidden>
+
+       * alloc.c: Handle unusual debugging option combinations.
+       (GC_CHECK_MARKED_OBJECTS): Undef if ! GC_MARK_STACK,
+       since the two debugging options are incompatible.
+       (GC_MALLOC_CHECK): Similarly, undef if GC_CHECK_MARKED_OBJECTS
+       is defined.
+       (mem_init, mem_insert, mem_insert_fixup):
+       Define if GC_MARK_STACK || GC_MALLOC_CHECK.
+       (NEED_MEM_INSERT): Remove; no longer needed.
+
 2012-04-22  Leo Liu  <address@hidden>
 
        * sysdep.c (list_system_processes): Support Darwin (Bug#5725).

=== modified file 'src/alloc.c'
--- a/src/alloc.c       2012-04-16 06:39:21 +0000
+++ b/src/alloc.c       2012-04-22 07:41:30 +0000
@@ -49,10 +49,18 @@
 #include <setjmp.h>
 #include <verify.h>
 
+/* GC_CHECK_MARKED_OBJECTS means do sanity checks on allocated objects.
+   Doable only if GC_MARK_STACK.  */
+#if ! GC_MARK_STACK
+# undef GC_CHECK_MARKED_OBJECTS
+#endif
+
 /* GC_MALLOC_CHECK defined means perform validity checks of malloc'd
-   memory.  Can do this only if using gmalloc.c.  */
+   memory.  Can do this only if using gmalloc.c and if not checking
+   marked objects.  */
 
-#if defined SYSTEM_MALLOC || defined DOUG_LEA_MALLOC
+#if (defined SYSTEM_MALLOC || defined DOUG_LEA_MALLOC \
+     || defined GC_CHECK_MARKED_OBJECTS)
 #undef GC_MALLOC_CHECK
 #endif
 
@@ -391,11 +399,8 @@
 static int live_misc_p (struct mem_node *, void *);
 static void mark_maybe_object (Lisp_Object);
 static void mark_memory (void *, void *);
+#if GC_MARK_STACK || defined GC_MALLOC_CHECK
 static void mem_init (void);
-#if (defined GC_MALLOC_CHECK                        \
-     ? !defined SYSTEM_MALLOC && !defined SYNC_INPUT \
-     : GC_MARK_STACK)
-# define NEED_MEM_INSERT
 static struct mem_node *mem_insert (void *, void *, enum mem_type);
 static void mem_insert_fixup (struct mem_node *);
 #endif
@@ -3578,8 +3583,6 @@
 }
 
 
-#ifdef NEED_MEM_INSERT
-
 /* Insert a new node into the tree for a block of memory with start
    address START, end address END, and type TYPE.  Value is a
    pointer to the node that was inserted.  */
@@ -3727,8 +3730,6 @@
   mem_root->color = MEM_BLACK;
 }
 
-#endif /* NEED_MEM_INSERT */
-
 
 /*   (x)                   (y)
      / \                   / \


reply via email to

[Prev in Thread] Current Thread [Next in Thread]