aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPaul Eggert2012-04-22 00:41:30 -0700
committerPaul Eggert2012-04-22 00:41:30 -0700
commit52828e02c36f599bfe75a527fecc16ace3fb6323 (patch)
tree5653261845893d33bd26fb3cd6e5fc0f0b321099
parent4b5b5289577b4cc89ee45595832f943ef9a43de6 (diff)
downloademacs-52828e02c36f599bfe75a527fecc16ace3fb6323.tar.gz
emacs-52828e02c36f599bfe75a527fecc16ace3fb6323.zip
* 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.
-rw-r--r--src/ChangeLog11
-rw-r--r--src/alloc.c21
2 files changed, 22 insertions, 10 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index a5777058d9c..fb7498b6298 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,14 @@
12012-04-22 Paul Eggert <eggert@cs.ucla.edu>
2
3 * alloc.c: Handle unusual debugging option combinations.
4 (GC_CHECK_MARKED_OBJECTS): Undef if ! GC_MARK_STACK,
5 since the two debugging options are incompatible.
6 (GC_MALLOC_CHECK): Similarly, undef if GC_CHECK_MARKED_OBJECTS
7 is defined.
8 (mem_init, mem_insert, mem_insert_fixup):
9 Define if GC_MARK_STACK || GC_MALLOC_CHECK.
10 (NEED_MEM_INSERT): Remove; no longer needed.
11
12012-04-22 Leo Liu <sdl.web@gmail.com> 122012-04-22 Leo Liu <sdl.web@gmail.com>
2 13
3 * sysdep.c (list_system_processes): Support Darwin (Bug#5725). 14 * sysdep.c (list_system_processes): Support Darwin (Bug#5725).
diff --git a/src/alloc.c b/src/alloc.c
index 400b11c296a..b029343a848 100644
--- a/src/alloc.c
+++ b/src/alloc.c
@@ -49,10 +49,18 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
49#include <setjmp.h> 49#include <setjmp.h>
50#include <verify.h> 50#include <verify.h>
51 51
52/* GC_CHECK_MARKED_OBJECTS means do sanity checks on allocated objects.
53 Doable only if GC_MARK_STACK. */
54#if ! GC_MARK_STACK
55# undef GC_CHECK_MARKED_OBJECTS
56#endif
57
52/* GC_MALLOC_CHECK defined means perform validity checks of malloc'd 58/* GC_MALLOC_CHECK defined means perform validity checks of malloc'd
53 memory. Can do this only if using gmalloc.c. */ 59 memory. Can do this only if using gmalloc.c and if not checking
60 marked objects. */
54 61
55#if defined SYSTEM_MALLOC || defined DOUG_LEA_MALLOC 62#if (defined SYSTEM_MALLOC || defined DOUG_LEA_MALLOC \
63 || defined GC_CHECK_MARKED_OBJECTS)
56#undef GC_MALLOC_CHECK 64#undef GC_MALLOC_CHECK
57#endif 65#endif
58 66
@@ -391,11 +399,8 @@ static int live_float_p (struct mem_node *, void *);
391static int live_misc_p (struct mem_node *, void *); 399static int live_misc_p (struct mem_node *, void *);
392static void mark_maybe_object (Lisp_Object); 400static void mark_maybe_object (Lisp_Object);
393static void mark_memory (void *, void *); 401static void mark_memory (void *, void *);
402#if GC_MARK_STACK || defined GC_MALLOC_CHECK
394static void mem_init (void); 403static void mem_init (void);
395#if (defined GC_MALLOC_CHECK \
396 ? !defined SYSTEM_MALLOC && !defined SYNC_INPUT \
397 : GC_MARK_STACK)
398# define NEED_MEM_INSERT
399static struct mem_node *mem_insert (void *, void *, enum mem_type); 404static struct mem_node *mem_insert (void *, void *, enum mem_type);
400static void mem_insert_fixup (struct mem_node *); 405static void mem_insert_fixup (struct mem_node *);
401#endif 406#endif
@@ -3578,8 +3583,6 @@ mem_find (void *start)
3578} 3583}
3579 3584
3580 3585
3581#ifdef NEED_MEM_INSERT
3582
3583/* Insert a new node into the tree for a block of memory with start 3586/* Insert a new node into the tree for a block of memory with start
3584 address START, end address END, and type TYPE. Value is a 3587 address START, end address END, and type TYPE. Value is a
3585 pointer to the node that was inserted. */ 3588 pointer to the node that was inserted. */
@@ -3727,8 +3730,6 @@ mem_insert_fixup (struct mem_node *x)
3727 mem_root->color = MEM_BLACK; 3730 mem_root->color = MEM_BLACK;
3728} 3731}
3729 3732
3730#endif /* NEED_MEM_INSERT */
3731
3732 3733
3733/* (x) (y) 3734/* (x) (y)
3734 / \ / \ 3735 / \ / \