aboutsummaryrefslogtreecommitdiffstats
path: root/src/alloc.c
diff options
context:
space:
mode:
authorPaul Eggert2011-04-15 00:48:51 -0700
committerPaul Eggert2011-04-15 00:48:51 -0700
commit4170f62f39edf1ff1e99aec9bfbfe7bbf10e7fc9 (patch)
treee993b231bb5555c9c961f5d0b20d90ac76f77bbd /src/alloc.c
parent1963a2e0bb07cc8dee6d27f972f93d9cfd7c6b2d (diff)
parent49093f601b69d91126aefd328ee8f6bfeb797407 (diff)
downloademacs-4170f62f39edf1ff1e99aec9bfbfe7bbf10e7fc9.tar.gz
emacs-4170f62f39edf1ff1e99aec9bfbfe7bbf10e7fc9.zip
Merge from mainline.
Diffstat (limited to 'src/alloc.c')
-rw-r--r--src/alloc.c36
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
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
@@ -264,11 +267,12 @@ static size_t stack_copy_size;
264 267
265static int ignore_warnings; 268static int ignore_warnings;
266 269
267Lisp_Object Qgc_cons_threshold, Qchar_table_extra_slots; 270static Lisp_Object Qgc_cons_threshold;
271Lisp_Object Qchar_table_extra_slots;
268 272
269/* Hook run after GC has finished. */ 273/* Hook run after GC has finished. */
270 274
271Lisp_Object Qpost_gc_hook; 275static Lisp_Object Qpost_gc_hook;
272 276
273static void mark_buffer (Lisp_Object); 277static void mark_buffer (Lisp_Object);
274static void mark_terminals (void); 278static void mark_terminals (void);
@@ -276,12 +280,14 @@ static void gc_sweep (void);
276static void mark_glyph_matrix (struct glyph_matrix *); 280static void mark_glyph_matrix (struct glyph_matrix *);
277static void mark_face_cache (struct face_cache *); 281static void mark_face_cache (struct face_cache *);
278 282
283#if !defined REL_ALLOC || defined SYSTEM_MALLOC
284static void refill_memory_reserve (void);
285#endif
279static struct Lisp_String *allocate_string (void); 286static struct Lisp_String *allocate_string (void);
280static void compact_small_strings (void); 287static void compact_small_strings (void);
281static void free_large_strings (void); 288static void free_large_strings (void);
282static void sweep_strings (void); 289static void sweep_strings (void);
283 290static void free_misc (Lisp_Object);
284extern 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
1339INTERVAL interval_free_list; 1345static 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
2458struct float_block *float_block; 2464static 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
2462int float_block_index; 2468static 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
2466int n_float_blocks; 2472static int n_float_blocks;
2467 2473
2468/* Free-list of Lisp_Floats. */ 2474/* Free-list of Lisp_Floats. */
2469 2475
2470struct Lisp_Float *float_free_list; 2476static 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
2570struct cons_block *cons_block; 2576static 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
2574int cons_block_index; 2580static int cons_block_index;
2575 2581
2576/* Free-list of Lisp_Cons structures. */ 2582/* Free-list of Lisp_Cons structures. */
2577 2583
2578struct Lisp_Cons *cons_free_list; 2584static 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
3166void 3172static void
3167free_misc (Lisp_Object misc) 3173free_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
5213static Lisp_Object last_marked[LAST_MARKED_SIZE]; 5219static Lisp_Object last_marked[LAST_MARKED_SIZE];
5214int last_marked_index; 5220static 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
6106int suppress_checking; 6113int suppress_checking;
6107 6114
6108void 6115void
@@ -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