aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorPaul Eggert2011-04-10 21:39:49 -0700
committerPaul Eggert2011-04-10 21:39:49 -0700
commit244ed9077fe7ccebbc15c7157cb45832f46a46d3 (patch)
tree4c3916d81881be940d2dd33d9abda979f88e5580 /src
parent955cbe7b1720f09b2991b7d981147d9cc79d52e3 (diff)
downloademacs-244ed9077fe7ccebbc15c7157cb45832f46a46d3.tar.gz
emacs-244ed9077fe7ccebbc15c7157cb45832f46a46d3.zip
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.
Diffstat (limited to 'src')
-rw-r--r--src/ChangeLog20
-rw-r--r--src/alloc.c28
-rw-r--r--src/eval.c25
-rw-r--r--src/lisp.h19
-rw-r--r--src/xdisp.c2
5 files changed, 65 insertions, 29 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index 0be406a6e7b..43358338c4d 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,5 +1,25 @@
12011-04-11 Paul Eggert <eggert@cs.ucla.edu> 12011-04-11 Paul Eggert <eggert@cs.ucla.edu>
2 2
3 alloc.c: Import and export fewer symbols, and remove unused items.
4 * lisp.h (suppress_checking, die): Declare only if ENABLE_CHECKING
5 is defined.
6 (suppress_checking): Add EXTERNALLY_VISIBLE attribute, so that
7 it's not optimized away by whole-program optimization.
8 (message_enable_multibyte, free_misc): Remove.
9 (catchlist, handlerlist, mark_backtrace):
10 Declare only if BYTE_MARK_STACK.
11 (mark_byte_stack): Likewise, fixing a ifdef-vs-if typo.
12 * alloc.c (pure): Export only if VIRT_ADDR_VARIES is defined.
13 (message_enable_multibyte): Remove decl.
14 (free_misc, interval_free_list, float_block, float_block_index):
15 (n_float_blocks, float_free_list, cons_block, cons_block_index):
16 (cons_free_list, last_marked_index):
17 Now static.
18 (suppress_checking, die): Define only if ENABLE_CHECKING is defined.
19 * eval.c (catchlist, handlerlist): Export only if BYTE_MARK_STACK.
20 (mark_backtrace): Define only if BYTE_MARK_STACK.
21 * xdisp.c (message_enable_multibyte): Now static.
22
3 Declare Lisp_Object Q* variables to be 'static' if not exproted. 23 Declare Lisp_Object Q* variables to be 'static' if not exproted.
4 This makes it easier for human readers (and static analyzers) 24 This makes it easier for human readers (and static analyzers)
5 to see whether these variables are used from other modules. 25 to see whether these variables are used from other modules.
diff --git a/src/alloc.c b/src/alloc.c
index ad3dfa96cd2..7803ccdc976 100644
--- a/src/alloc.c
+++ b/src/alloc.c
@@ -212,6 +212,9 @@ static int malloc_hysteresis;
212 remapping on more recent systems because this is less important 212 remapping on more recent systems because this is less important
213 nowadays than in the days of small memories and timesharing. */ 213 nowadays than in the days of small memories and timesharing. */
214 214
215#ifndef VIRT_ADDR_VARIES
216static
217#endif
215EMACS_INT pure[(PURESIZE + sizeof (EMACS_INT) - 1) / sizeof (EMACS_INT)] = {1,}; 218EMACS_INT pure[(PURESIZE + sizeof (EMACS_INT) - 1) / sizeof (EMACS_INT)] = {1,};
216#define PUREBEG (char *) pure 219#define PUREBEG (char *) pure
217 220
@@ -281,8 +284,7 @@ static struct Lisp_String *allocate_string (void);
281static void compact_small_strings (void); 284static void compact_small_strings (void);
282static void free_large_strings (void); 285static void free_large_strings (void);
283static void sweep_strings (void); 286static void sweep_strings (void);
284 287static void free_misc (Lisp_Object);
285extern int message_enable_multibyte;
286 288
287/* When scanning the C stack for live Lisp objects, Emacs keeps track 289/* When scanning the C stack for live Lisp objects, Emacs keeps track
288 of what memory allocated via lisp_malloc is intended for what 290 of what memory allocated via lisp_malloc is intended for what
@@ -1341,7 +1343,7 @@ static int total_free_intervals, total_intervals;
1341 1343
1342/* List of free intervals. */ 1344/* List of free intervals. */
1343 1345
1344INTERVAL interval_free_list; 1346static INTERVAL interval_free_list;
1345 1347
1346/* Total number of interval blocks now in use. */ 1348/* Total number of interval blocks now in use. */
1347 1349
@@ -2460,19 +2462,19 @@ struct float_block
2460 2462
2461/* Current float_block. */ 2463/* Current float_block. */
2462 2464
2463struct float_block *float_block; 2465static struct float_block *float_block;
2464 2466
2465/* Index of first unused Lisp_Float in the current float_block. */ 2467/* Index of first unused Lisp_Float in the current float_block. */
2466 2468
2467int float_block_index; 2469static int float_block_index;
2468 2470
2469/* Total number of float blocks now in use. */ 2471/* Total number of float blocks now in use. */
2470 2472
2471int n_float_blocks; 2473static int n_float_blocks;
2472 2474
2473/* Free-list of Lisp_Floats. */ 2475/* Free-list of Lisp_Floats. */
2474 2476
2475struct Lisp_Float *float_free_list; 2477static struct Lisp_Float *float_free_list;
2476 2478
2477 2479
2478/* Initialize float allocation. */ 2480/* Initialize float allocation. */
@@ -2572,15 +2574,15 @@ struct cons_block
2572 2574
2573/* Current cons_block. */ 2575/* Current cons_block. */
2574 2576
2575struct cons_block *cons_block; 2577static struct cons_block *cons_block;
2576 2578
2577/* Index of first unused Lisp_Cons in the current block. */ 2579/* Index of first unused Lisp_Cons in the current block. */
2578 2580
2579int cons_block_index; 2581static int cons_block_index;
2580 2582
2581/* Free-list of Lisp_Cons structures. */ 2583/* Free-list of Lisp_Cons structures. */
2582 2584
2583struct Lisp_Cons *cons_free_list; 2585static struct Lisp_Cons *cons_free_list;
2584 2586
2585/* Total number of cons blocks now in use. */ 2587/* Total number of cons blocks now in use. */
2586 2588
@@ -3168,7 +3170,7 @@ allocate_misc (void)
3168 3170
3169/* Free a Lisp_Misc object */ 3171/* Free a Lisp_Misc object */
3170 3172
3171void 3173static void
3172free_misc (Lisp_Object misc) 3174free_misc (Lisp_Object misc)
3173{ 3175{
3174 XMISCTYPE (misc) = Lisp_Misc_Free; 3176 XMISCTYPE (misc) = Lisp_Misc_Free;
@@ -5216,7 +5218,7 @@ mark_face_cache (struct face_cache *c)
5216 5218
5217#define LAST_MARKED_SIZE 500 5219#define LAST_MARKED_SIZE 500
5218static Lisp_Object last_marked[LAST_MARKED_SIZE]; 5220static Lisp_Object last_marked[LAST_MARKED_SIZE];
5219int last_marked_index; 5221static int last_marked_index;
5220 5222
5221/* For debugging--call abort when we cdr down this many 5223/* For debugging--call abort when we cdr down this many
5222 links of a list, in mark_object. In debugging, 5224 links of a list, in mark_object. In debugging,
@@ -6108,6 +6110,7 @@ Frames, windows, buffers, and subprocesses count as vectors
6108 return Flist (8, consed); 6110 return Flist (8, consed);
6109} 6111}
6110 6112
6113#ifdef ENABLE_CHECKING
6111int suppress_checking; 6114int suppress_checking;
6112 6115
6113void 6116void
@@ -6117,6 +6120,7 @@ die (const char *msg, const char *file, int line)
6117 file, line, msg); 6120 file, line, msg);
6118 abort (); 6121 abort ();
6119} 6122}
6123#endif
6120 6124
6121/* Initialization */ 6125/* Initialization */
6122 6126
diff --git a/src/eval.c b/src/eval.c
index cefdf784faf..dddedc77286 100644
--- a/src/eval.c
+++ b/src/eval.c
@@ -57,8 +57,23 @@ struct backtrace
57}; 57};
58 58
59struct backtrace *backtrace_list; 59struct backtrace *backtrace_list;
60
61#if !BYTE_MARK_STACK
62static
63#endif
60struct catchtag *catchlist; 64struct catchtag *catchlist;
61 65
66/* Chain of condition handlers currently in effect.
67 The elements of this chain are contained in the stack frames
68 of Fcondition_case and internal_condition_case.
69 When an error is signaled (by calling Fsignal, below),
70 this chain is searched for an element that applies. */
71
72#if !BYTE_MARK_STACK
73static
74#endif
75struct handler *handlerlist;
76
62#ifdef DEBUG_GCPRO 77#ifdef DEBUG_GCPRO
63/* Count levels of GCPRO to detect failure to UNGCPRO. */ 78/* Count levels of GCPRO to detect failure to UNGCPRO. */
64int gcpro_level; 79int gcpro_level;
@@ -1345,14 +1360,6 @@ usage: (unwind-protect BODYFORM UNWINDFORMS...) */)
1345 return unbind_to (count, val); 1360 return unbind_to (count, val);
1346} 1361}
1347 1362
1348/* Chain of condition handlers currently in effect.
1349 The elements of this chain are contained in the stack frames
1350 of Fcondition_case and internal_condition_case.
1351 When an error is signaled (by calling Fsignal, below),
1352 this chain is searched for an element that applies. */
1353
1354struct handler *handlerlist;
1355
1356DEFUN ("condition-case", Fcondition_case, Scondition_case, 2, UNEVALLED, 0, 1363DEFUN ("condition-case", Fcondition_case, Scondition_case, 2, UNEVALLED, 0,
1357 doc: /* Regain control when an error is signaled. 1364 doc: /* Regain control when an error is signaled.
1358Executes BODYFORM and returns its value if no error happens. 1365Executes BODYFORM and returns its value if no error happens.
@@ -3629,6 +3636,7 @@ If NFRAMES is more than the number of frames, the value is nil. */)
3629} 3636}
3630 3637
3631 3638
3639#if BYTE_MARK_STACK
3632void 3640void
3633mark_backtrace (void) 3641mark_backtrace (void)
3634{ 3642{
@@ -3648,6 +3656,7 @@ mark_backtrace (void)
3648 mark_object (backlist->args[i]); 3656 mark_object (backlist->args[i]);
3649 } 3657 }
3650} 3658}
3659#endif
3651 3660
3652void 3661void
3653syms_of_eval (void) 3662syms_of_eval (void)
diff --git a/src/lisp.h b/src/lisp.h
index fb44002b6a6..b06626ad379 100644
--- a/src/lisp.h
+++ b/src/lisp.h
@@ -55,11 +55,11 @@ extern void check_cons_list (void);
55#endif 55#endif
56 56
57/* Extra internal type checking? */ 57/* Extra internal type checking? */
58extern int suppress_checking;
59extern void die (const char *, const char *, int) NO_RETURN;
60 58
61#ifdef ENABLE_CHECKING 59#ifdef ENABLE_CHECKING
62 60
61extern void die (const char *, const char *, int) NO_RETURN;
62
63/* The suppress_checking variable is initialized to 0 in alloc.c. Set 63/* The suppress_checking variable is initialized to 0 in alloc.c. Set
64 it to 1 using a debugger to temporarily disable aborting on 64 it to 1 using a debugger to temporarily disable aborting on
65 detected internal inconsistencies or error conditions. 65 detected internal inconsistencies or error conditions.
@@ -74,6 +74,8 @@ extern void die (const char *, const char *, int) NO_RETURN;
74 STRINGP (x), but a particular use of XSTRING is invoked only after 74 STRINGP (x), but a particular use of XSTRING is invoked only after
75 testing that STRINGP (x) is true, making the test redundant. */ 75 testing that STRINGP (x) is true, making the test redundant. */
76 76
77extern int suppress_checking EXTERNALLY_VISIBLE;
78
77#define CHECK(check,msg) (((check) || suppress_checking \ 79#define CHECK(check,msg) (((check) || suppress_checking \
78 ? (void) 0 \ 80 ? (void) 0 \
79 : die ((msg), __FILE__, __LINE__)), \ 81 : die ((msg), __FILE__, __LINE__)), \
@@ -1968,8 +1970,6 @@ struct handler
1968 struct handler *next; 1970 struct handler *next;
1969 }; 1971 };
1970 1972
1971extern struct handler *handlerlist;
1972
1973/* This structure helps implement the `catch' and `throw' control 1973/* This structure helps implement the `catch' and `throw' control
1974 structure. A struct catchtag contains all the information needed 1974 structure. A struct catchtag contains all the information needed
1975 to restore the state of the interpreter after a non-local jump. 1975 to restore the state of the interpreter after a non-local jump.
@@ -2005,7 +2005,6 @@ struct catchtag
2005 struct byte_stack *byte_stack; 2005 struct byte_stack *byte_stack;
2006}; 2006};
2007 2007
2008extern struct catchtag *catchlist;
2009extern struct backtrace *backtrace_list; 2008extern struct backtrace *backtrace_list;
2010 2009
2011extern Lisp_Object memory_signal_data; 2010extern Lisp_Object memory_signal_data;
@@ -2615,7 +2614,6 @@ extern Lisp_Object Qrisky_local_variable;
2615extern struct frame *last_glyphless_glyph_frame; 2614extern struct frame *last_glyphless_glyph_frame;
2616extern unsigned last_glyphless_glyph_face_id; 2615extern unsigned last_glyphless_glyph_face_id;
2617extern int last_glyphless_glyph_merged_face_id; 2616extern int last_glyphless_glyph_merged_face_id;
2618extern int message_enable_multibyte;
2619extern int noninteractive_need_newline; 2617extern int noninteractive_need_newline;
2620extern Lisp_Object echo_area_buffer[2]; 2618extern Lisp_Object echo_area_buffer[2];
2621extern void add_to_log (const char *, Lisp_Object, Lisp_Object); 2619extern void add_to_log (const char *, Lisp_Object, Lisp_Object);
@@ -2724,7 +2722,6 @@ extern Lisp_Object make_float (double);
2724extern void display_malloc_warning (void); 2722extern void display_malloc_warning (void);
2725extern int inhibit_garbage_collection (void); 2723extern int inhibit_garbage_collection (void);
2726extern Lisp_Object make_save_value (void *, int); 2724extern Lisp_Object make_save_value (void *, int);
2727extern void free_misc (Lisp_Object);
2728extern void free_marker (Lisp_Object); 2725extern void free_marker (Lisp_Object);
2729extern void free_cons (struct Lisp_Cons *); 2726extern void free_cons (struct Lisp_Cons *);
2730extern void init_alloc_once (void); 2727extern void init_alloc_once (void);
@@ -2822,6 +2819,10 @@ extern Lisp_Object Qand_rest;
2822extern Lisp_Object Vautoload_queue; 2819extern Lisp_Object Vautoload_queue;
2823extern Lisp_Object Vsignaling_function; 2820extern Lisp_Object Vsignaling_function;
2824extern int handling_signal; 2821extern int handling_signal;
2822#if BYTE_MARK_STACK
2823extern struct catchtag *catchlist;
2824extern struct handler *handlerlist;
2825#endif
2825/* To run a normal hook, use the appropriate function from the list below. 2826/* To run a normal hook, use the appropriate function from the list below.
2826 The calling convention: 2827 The calling convention:
2827 2828
@@ -2882,7 +2883,9 @@ extern Lisp_Object safe_call (size_t, Lisp_Object *);
2882extern Lisp_Object safe_call1 (Lisp_Object, Lisp_Object); 2883extern Lisp_Object safe_call1 (Lisp_Object, Lisp_Object);
2883extern Lisp_Object safe_call2 (Lisp_Object, Lisp_Object, Lisp_Object); 2884extern Lisp_Object safe_call2 (Lisp_Object, Lisp_Object, Lisp_Object);
2884extern void init_eval (void); 2885extern void init_eval (void);
2886#if BYTE_MARK_STACK
2885extern void mark_backtrace (void); 2887extern void mark_backtrace (void);
2888#endif
2886extern void syms_of_eval (void); 2889extern void syms_of_eval (void);
2887 2890
2888/* Defined in editfns.c */ 2891/* Defined in editfns.c */
@@ -3255,7 +3258,7 @@ extern int read_bytecode_char (int);
3255extern Lisp_Object Qbytecode; 3258extern Lisp_Object Qbytecode;
3256extern void syms_of_bytecode (void); 3259extern void syms_of_bytecode (void);
3257extern struct byte_stack *byte_stack_list; 3260extern struct byte_stack *byte_stack_list;
3258#ifdef BYTE_MARK_STACK 3261#if BYTE_MARK_STACK
3259extern void mark_byte_stack (void); 3262extern void mark_byte_stack (void);
3260#endif 3263#endif
3261extern void unmark_byte_stack (void); 3264extern void unmark_byte_stack (void);
diff --git a/src/xdisp.c b/src/xdisp.c
index b5ba2090c70..ec9a112996f 100644
--- a/src/xdisp.c
+++ b/src/xdisp.c
@@ -504,7 +504,7 @@ Lisp_Object Vmessage_stack;
504/* Nonzero means multibyte characters were enabled when the echo area 504/* Nonzero means multibyte characters were enabled when the echo area
505 message was specified. */ 505 message was specified. */
506 506
507int message_enable_multibyte; 507static int message_enable_multibyte;
508 508
509/* Nonzero if we should redraw the mode lines on the next redisplay. */ 509/* Nonzero if we should redraw the mode lines on the next redisplay. */
510 510