diff options
| author | Paul Eggert | 2011-04-10 21:39:49 -0700 |
|---|---|---|
| committer | Paul Eggert | 2011-04-10 21:39:49 -0700 |
| commit | 244ed9077fe7ccebbc15c7157cb45832f46a46d3 (patch) | |
| tree | 4c3916d81881be940d2dd33d9abda979f88e5580 /src/alloc.c | |
| parent | 955cbe7b1720f09b2991b7d981147d9cc79d52e3 (diff) | |
| download | emacs-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/alloc.c')
| -rw-r--r-- | src/alloc.c | 28 |
1 files changed, 16 insertions, 12 deletions
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 | ||
| 216 | static | ||
| 217 | #endif | ||
| 215 | EMACS_INT pure[(PURESIZE + sizeof (EMACS_INT) - 1) / sizeof (EMACS_INT)] = {1,}; | 218 | EMACS_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); | |||
| 281 | static void compact_small_strings (void); | 284 | static void compact_small_strings (void); |
| 282 | static void free_large_strings (void); | 285 | static void free_large_strings (void); |
| 283 | static void sweep_strings (void); | 286 | static void sweep_strings (void); |
| 284 | 287 | static void free_misc (Lisp_Object); | |
| 285 | extern 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 | ||
| 1344 | INTERVAL interval_free_list; | 1346 | static 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 | ||
| 2463 | struct float_block *float_block; | 2465 | static 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 | ||
| 2467 | int float_block_index; | 2469 | static 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 | ||
| 2471 | int n_float_blocks; | 2473 | static int n_float_blocks; |
| 2472 | 2474 | ||
| 2473 | /* Free-list of Lisp_Floats. */ | 2475 | /* Free-list of Lisp_Floats. */ |
| 2474 | 2476 | ||
| 2475 | struct Lisp_Float *float_free_list; | 2477 | static 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 | ||
| 2575 | struct cons_block *cons_block; | 2577 | static 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 | ||
| 2579 | int cons_block_index; | 2581 | static int cons_block_index; |
| 2580 | 2582 | ||
| 2581 | /* Free-list of Lisp_Cons structures. */ | 2583 | /* Free-list of Lisp_Cons structures. */ |
| 2582 | 2584 | ||
| 2583 | struct Lisp_Cons *cons_free_list; | 2585 | static 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 | ||
| 3171 | void | 3173 | static void |
| 3172 | free_misc (Lisp_Object misc) | 3174 | free_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 |
| 5218 | static Lisp_Object last_marked[LAST_MARKED_SIZE]; | 5220 | static Lisp_Object last_marked[LAST_MARKED_SIZE]; |
| 5219 | int last_marked_index; | 5221 | static 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 | ||
| 6111 | int suppress_checking; | 6114 | int suppress_checking; |
| 6112 | 6115 | ||
| 6113 | void | 6116 | void |
| @@ -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 | ||