diff options
| author | Paul Eggert | 2011-04-15 00:48:51 -0700 |
|---|---|---|
| committer | Paul Eggert | 2011-04-15 00:48:51 -0700 |
| commit | 4170f62f39edf1ff1e99aec9bfbfe7bbf10e7fc9 (patch) | |
| tree | e993b231bb5555c9c961f5d0b20d90ac76f77bbd /src/alloc.c | |
| parent | 1963a2e0bb07cc8dee6d27f972f93d9cfd7c6b2d (diff) | |
| parent | 49093f601b69d91126aefd328ee8f6bfeb797407 (diff) | |
| download | emacs-4170f62f39edf1ff1e99aec9bfbfe7bbf10e7fc9.tar.gz emacs-4170f62f39edf1ff1e99aec9bfbfe7bbf10e7fc9.zip | |
Merge from mainline.
Diffstat (limited to 'src/alloc.c')
| -rw-r--r-- | src/alloc.c | 36 |
1 files changed, 22 insertions, 14 deletions
diff --git a/src/alloc.c b/src/alloc.c index 6a018b87029..16cd183aaa1 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 | ||
| @@ -264,11 +267,12 @@ static size_t stack_copy_size; | |||
| 264 | 267 | ||
| 265 | static int ignore_warnings; | 268 | static int ignore_warnings; |
| 266 | 269 | ||
| 267 | Lisp_Object Qgc_cons_threshold, Qchar_table_extra_slots; | 270 | static Lisp_Object Qgc_cons_threshold; |
| 271 | Lisp_Object Qchar_table_extra_slots; | ||
| 268 | 272 | ||
| 269 | /* Hook run after GC has finished. */ | 273 | /* Hook run after GC has finished. */ |
| 270 | 274 | ||
| 271 | Lisp_Object Qpost_gc_hook; | 275 | static Lisp_Object Qpost_gc_hook; |
| 272 | 276 | ||
| 273 | static void mark_buffer (Lisp_Object); | 277 | static void mark_buffer (Lisp_Object); |
| 274 | static void mark_terminals (void); | 278 | static void mark_terminals (void); |
| @@ -276,12 +280,14 @@ static void gc_sweep (void); | |||
| 276 | static void mark_glyph_matrix (struct glyph_matrix *); | 280 | static void mark_glyph_matrix (struct glyph_matrix *); |
| 277 | static void mark_face_cache (struct face_cache *); | 281 | static void mark_face_cache (struct face_cache *); |
| 278 | 282 | ||
| 283 | #if !defined REL_ALLOC || defined SYSTEM_MALLOC | ||
| 284 | static void refill_memory_reserve (void); | ||
| 285 | #endif | ||
| 279 | static struct Lisp_String *allocate_string (void); | 286 | static struct Lisp_String *allocate_string (void); |
| 280 | static void compact_small_strings (void); | 287 | static void compact_small_strings (void); |
| 281 | static void free_large_strings (void); | 288 | static void free_large_strings (void); |
| 282 | static void sweep_strings (void); | 289 | static void sweep_strings (void); |
| 283 | 290 | static void free_misc (Lisp_Object); | |
| 284 | extern int message_enable_multibyte; | ||
| 285 | 291 | ||
| 286 | /* When scanning the C stack for live Lisp objects, Emacs keeps track | 292 | /* When scanning the C stack for live Lisp objects, Emacs keeps track |
| 287 | of what memory allocated via lisp_malloc is intended for what | 293 | of what memory allocated via lisp_malloc is intended for what |
| @@ -1336,7 +1342,7 @@ static int total_free_intervals, total_intervals; | |||
| 1336 | 1342 | ||
| 1337 | /* List of free intervals. */ | 1343 | /* List of free intervals. */ |
| 1338 | 1344 | ||
| 1339 | INTERVAL interval_free_list; | 1345 | static INTERVAL interval_free_list; |
| 1340 | 1346 | ||
| 1341 | /* Total number of interval blocks now in use. */ | 1347 | /* Total number of interval blocks now in use. */ |
| 1342 | 1348 | ||
| @@ -2455,19 +2461,19 @@ struct float_block | |||
| 2455 | 2461 | ||
| 2456 | /* Current float_block. */ | 2462 | /* Current float_block. */ |
| 2457 | 2463 | ||
| 2458 | struct float_block *float_block; | 2464 | static struct float_block *float_block; |
| 2459 | 2465 | ||
| 2460 | /* Index of first unused Lisp_Float in the current float_block. */ | 2466 | /* Index of first unused Lisp_Float in the current float_block. */ |
| 2461 | 2467 | ||
| 2462 | int float_block_index; | 2468 | static int float_block_index; |
| 2463 | 2469 | ||
| 2464 | /* Total number of float blocks now in use. */ | 2470 | /* Total number of float blocks now in use. */ |
| 2465 | 2471 | ||
| 2466 | int n_float_blocks; | 2472 | static int n_float_blocks; |
| 2467 | 2473 | ||
| 2468 | /* Free-list of Lisp_Floats. */ | 2474 | /* Free-list of Lisp_Floats. */ |
| 2469 | 2475 | ||
| 2470 | struct Lisp_Float *float_free_list; | 2476 | static struct Lisp_Float *float_free_list; |
| 2471 | 2477 | ||
| 2472 | 2478 | ||
| 2473 | /* Initialize float allocation. */ | 2479 | /* Initialize float allocation. */ |
| @@ -2567,15 +2573,15 @@ struct cons_block | |||
| 2567 | 2573 | ||
| 2568 | /* Current cons_block. */ | 2574 | /* Current cons_block. */ |
| 2569 | 2575 | ||
| 2570 | struct cons_block *cons_block; | 2576 | static struct cons_block *cons_block; |
| 2571 | 2577 | ||
| 2572 | /* Index of first unused Lisp_Cons in the current block. */ | 2578 | /* Index of first unused Lisp_Cons in the current block. */ |
| 2573 | 2579 | ||
| 2574 | int cons_block_index; | 2580 | static int cons_block_index; |
| 2575 | 2581 | ||
| 2576 | /* Free-list of Lisp_Cons structures. */ | 2582 | /* Free-list of Lisp_Cons structures. */ |
| 2577 | 2583 | ||
| 2578 | struct Lisp_Cons *cons_free_list; | 2584 | static struct Lisp_Cons *cons_free_list; |
| 2579 | 2585 | ||
| 2580 | /* Total number of cons blocks now in use. */ | 2586 | /* Total number of cons blocks now in use. */ |
| 2581 | 2587 | ||
| @@ -3163,7 +3169,7 @@ allocate_misc (void) | |||
| 3163 | 3169 | ||
| 3164 | /* Free a Lisp_Misc object */ | 3170 | /* Free a Lisp_Misc object */ |
| 3165 | 3171 | ||
| 3166 | void | 3172 | static void |
| 3167 | free_misc (Lisp_Object misc) | 3173 | free_misc (Lisp_Object misc) |
| 3168 | { | 3174 | { |
| 3169 | XMISCTYPE (misc) = Lisp_Misc_Free; | 3175 | XMISCTYPE (misc) = Lisp_Misc_Free; |
| @@ -5211,7 +5217,7 @@ mark_face_cache (struct face_cache *c) | |||
| 5211 | 5217 | ||
| 5212 | #define LAST_MARKED_SIZE 500 | 5218 | #define LAST_MARKED_SIZE 500 |
| 5213 | static Lisp_Object last_marked[LAST_MARKED_SIZE]; | 5219 | static Lisp_Object last_marked[LAST_MARKED_SIZE]; |
| 5214 | int last_marked_index; | 5220 | static int last_marked_index; |
| 5215 | 5221 | ||
| 5216 | /* For debugging--call abort when we cdr down this many | 5222 | /* For debugging--call abort when we cdr down this many |
| 5217 | links of a list, in mark_object. In debugging, | 5223 | links of a list, in mark_object. In debugging, |
| @@ -6103,6 +6109,7 @@ Frames, windows, buffers, and subprocesses count as vectors | |||
| 6103 | return Flist (8, consed); | 6109 | return Flist (8, consed); |
| 6104 | } | 6110 | } |
| 6105 | 6111 | ||
| 6112 | #ifdef ENABLE_CHECKING | ||
| 6106 | int suppress_checking; | 6113 | int suppress_checking; |
| 6107 | 6114 | ||
| 6108 | void | 6115 | void |
| @@ -6112,6 +6119,7 @@ die (const char *msg, const char *file, int line) | |||
| 6112 | file, line, msg); | 6119 | file, line, msg); |
| 6113 | abort (); | 6120 | abort (); |
| 6114 | } | 6121 | } |
| 6122 | #endif | ||
| 6115 | 6123 | ||
| 6116 | /* Initialization */ | 6124 | /* Initialization */ |
| 6117 | 6125 | ||