2011-04-11 Paul Eggert <eggert@cs.ucla.edu>
+ alloc.c: Import and export fewer symbols, and remove unused items.
+ * lisp.h (suppress_checking, die): Declare only if ENABLE_CHECKING
+ is defined.
+ (suppress_checking): Add EXTERNALLY_VISIBLE attribute, so that
+ it's not optimized away by whole-program optimization.
+ (message_enable_multibyte, free_misc): Remove.
+ (catchlist, handlerlist, mark_backtrace):
+ Declare only if BYTE_MARK_STACK.
+ (mark_byte_stack): Likewise, fixing a ifdef-vs-if typo.
+ * alloc.c (pure): Export only if VIRT_ADDR_VARIES is defined.
+ (message_enable_multibyte): Remove decl.
+ (free_misc, interval_free_list, float_block, float_block_index):
+ (n_float_blocks, float_free_list, cons_block, cons_block_index):
+ (cons_free_list, last_marked_index):
+ Now static.
+ (suppress_checking, die): Define only if ENABLE_CHECKING is defined.
+ * eval.c (catchlist, handlerlist): Export only if BYTE_MARK_STACK.
+ (mark_backtrace): Define only if BYTE_MARK_STACK.
+ * xdisp.c (message_enable_multibyte): Now static.
+
Declare Lisp_Object Q* variables to be 'static' if not exproted.
This makes it easier for human readers (and static analyzers)
to see whether these variables are used from other modules.
remapping on more recent systems because this is less important
nowadays than in the days of small memories and timesharing. */
+#ifndef VIRT_ADDR_VARIES
+static
+#endif
EMACS_INT pure[(PURESIZE + sizeof (EMACS_INT) - 1) / sizeof (EMACS_INT)] = {1,};
#define PUREBEG (char *) pure
static void compact_small_strings (void);
static void free_large_strings (void);
static void sweep_strings (void);
-
-extern int message_enable_multibyte;
+static void free_misc (Lisp_Object);
/* When scanning the C stack for live Lisp objects, Emacs keeps track
of what memory allocated via lisp_malloc is intended for what
/* List of free intervals. */
-INTERVAL interval_free_list;
+static INTERVAL interval_free_list;
/* Total number of interval blocks now in use. */
/* Current float_block. */
-struct float_block *float_block;
+static struct float_block *float_block;
/* Index of first unused Lisp_Float in the current float_block. */
-int float_block_index;
+static int float_block_index;
/* Total number of float blocks now in use. */
-int n_float_blocks;
+static int n_float_blocks;
/* Free-list of Lisp_Floats. */
-struct Lisp_Float *float_free_list;
+static struct Lisp_Float *float_free_list;
/* Initialize float allocation. */
/* Current cons_block. */
-struct cons_block *cons_block;
+static struct cons_block *cons_block;
/* Index of first unused Lisp_Cons in the current block. */
-int cons_block_index;
+static int cons_block_index;
/* Free-list of Lisp_Cons structures. */
-struct Lisp_Cons *cons_free_list;
+static struct Lisp_Cons *cons_free_list;
/* Total number of cons blocks now in use. */
/* Free a Lisp_Misc object */
-void
+static void
free_misc (Lisp_Object misc)
{
XMISCTYPE (misc) = Lisp_Misc_Free;
#define LAST_MARKED_SIZE 500
static Lisp_Object last_marked[LAST_MARKED_SIZE];
-int last_marked_index;
+static int last_marked_index;
/* For debugging--call abort when we cdr down this many
links of a list, in mark_object. In debugging,
return Flist (8, consed);
}
+#ifdef ENABLE_CHECKING
int suppress_checking;
void
file, line, msg);
abort ();
}
+#endif
\f
/* Initialization */
};
struct backtrace *backtrace_list;
+
+#if !BYTE_MARK_STACK
+static
+#endif
struct catchtag *catchlist;
+/* Chain of condition handlers currently in effect.
+ The elements of this chain are contained in the stack frames
+ of Fcondition_case and internal_condition_case.
+ When an error is signaled (by calling Fsignal, below),
+ this chain is searched for an element that applies. */
+
+#if !BYTE_MARK_STACK
+static
+#endif
+struct handler *handlerlist;
+
#ifdef DEBUG_GCPRO
/* Count levels of GCPRO to detect failure to UNGCPRO. */
int gcpro_level;
return unbind_to (count, val);
}
\f
-/* Chain of condition handlers currently in effect.
- The elements of this chain are contained in the stack frames
- of Fcondition_case and internal_condition_case.
- When an error is signaled (by calling Fsignal, below),
- this chain is searched for an element that applies. */
-
-struct handler *handlerlist;
-
DEFUN ("condition-case", Fcondition_case, Scondition_case, 2, UNEVALLED, 0,
doc: /* Regain control when an error is signaled.
Executes BODYFORM and returns its value if no error happens.
}
\f
+#if BYTE_MARK_STACK
void
mark_backtrace (void)
{
mark_object (backlist->args[i]);
}
}
+#endif
void
syms_of_eval (void)
#endif
/* Extra internal type checking? */
-extern int suppress_checking;
-extern void die (const char *, const char *, int) NO_RETURN;
#ifdef ENABLE_CHECKING
+extern void die (const char *, const char *, int) NO_RETURN;
+
/* The suppress_checking variable is initialized to 0 in alloc.c. Set
it to 1 using a debugger to temporarily disable aborting on
detected internal inconsistencies or error conditions.
STRINGP (x), but a particular use of XSTRING is invoked only after
testing that STRINGP (x) is true, making the test redundant. */
+extern int suppress_checking EXTERNALLY_VISIBLE;
+
#define CHECK(check,msg) (((check) || suppress_checking \
? (void) 0 \
: die ((msg), __FILE__, __LINE__)), \
struct handler *next;
};
-extern struct handler *handlerlist;
-
/* This structure helps implement the `catch' and `throw' control
structure. A struct catchtag contains all the information needed
to restore the state of the interpreter after a non-local jump.
struct byte_stack *byte_stack;
};
-extern struct catchtag *catchlist;
extern struct backtrace *backtrace_list;
extern Lisp_Object memory_signal_data;
extern struct frame *last_glyphless_glyph_frame;
extern unsigned last_glyphless_glyph_face_id;
extern int last_glyphless_glyph_merged_face_id;
-extern int message_enable_multibyte;
extern int noninteractive_need_newline;
extern Lisp_Object echo_area_buffer[2];
extern void add_to_log (const char *, Lisp_Object, Lisp_Object);
extern void display_malloc_warning (void);
extern int inhibit_garbage_collection (void);
extern Lisp_Object make_save_value (void *, int);
-extern void free_misc (Lisp_Object);
extern void free_marker (Lisp_Object);
extern void free_cons (struct Lisp_Cons *);
extern void init_alloc_once (void);
extern Lisp_Object Vautoload_queue;
extern Lisp_Object Vsignaling_function;
extern int handling_signal;
+#if BYTE_MARK_STACK
+extern struct catchtag *catchlist;
+extern struct handler *handlerlist;
+#endif
/* To run a normal hook, use the appropriate function from the list below.
The calling convention:
extern Lisp_Object safe_call1 (Lisp_Object, Lisp_Object);
extern Lisp_Object safe_call2 (Lisp_Object, Lisp_Object, Lisp_Object);
extern void init_eval (void);
+#if BYTE_MARK_STACK
extern void mark_backtrace (void);
+#endif
extern void syms_of_eval (void);
/* Defined in editfns.c */
extern Lisp_Object Qbytecode;
extern void syms_of_bytecode (void);
extern struct byte_stack *byte_stack_list;
-#ifdef BYTE_MARK_STACK
+#if BYTE_MARK_STACK
extern void mark_byte_stack (void);
#endif
extern void unmark_byte_stack (void);
/* Nonzero means multibyte characters were enabled when the echo area
message was specified. */
-int message_enable_multibyte;
+static int message_enable_multibyte;
/* Nonzero if we should redraw the mode lines on the next redisplay. */