aboutsummaryrefslogtreecommitdiffstats
path: root/src/alloc.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/alloc.c')
-rw-r--r--src/alloc.c21
1 files changed, 11 insertions, 10 deletions
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 / \ / \