diff options
| author | Miles Bader | 2007-10-27 09:12:07 +0000 |
|---|---|---|
| committer | Miles Bader | 2007-10-27 09:12:07 +0000 |
| commit | 18cd1f1a08833b0baad21c1d7b13a6845d95cf57 (patch) | |
| tree | 03f33df7513d15bd5de0348aec35ef82bd061508 /src/alloc.c | |
| parent | 74863e7a78b1c8da1094a8250660a009c3b23015 (diff) | |
| parent | fdc9061358d3654e14bfc1419632e1d6c6c5c13e (diff) | |
| download | emacs-18cd1f1a08833b0baad21c1d7b13a6845d95cf57.tar.gz emacs-18cd1f1a08833b0baad21c1d7b13a6845d95cf57.zip | |
Merge from emacs--devo--0
Patches applied:
* emacs--devo--0 (patch 902-908)
- Update from CVS
- Merge from emacs--rel--22
* emacs--rel--22 (patch 131-137)
- Update from CVS
- Merge from gnus--rel--5.10
* gnus--rel--5.10 (patch 261-262)
- Update from CVS
Revision: emacs@sv.gnu.org/emacs--unicode--0--patch-278
Diffstat (limited to 'src/alloc.c')
| -rw-r--r-- | src/alloc.c | 75 |
1 files changed, 38 insertions, 37 deletions
diff --git a/src/alloc.c b/src/alloc.c index 295da59d026..80abe170748 100644 --- a/src/alloc.c +++ b/src/alloc.c | |||
| @@ -241,7 +241,7 @@ static int total_free_floats, total_floats; | |||
| 241 | out of memory. We keep one large block, four cons-blocks, and | 241 | out of memory. We keep one large block, four cons-blocks, and |
| 242 | two string blocks. */ | 242 | two string blocks. */ |
| 243 | 243 | ||
| 244 | char *spare_memory[7]; | 244 | static char *spare_memory[7]; |
| 245 | 245 | ||
| 246 | /* Amount of spare memory to keep in large reserve block. */ | 246 | /* Amount of spare memory to keep in large reserve block. */ |
| 247 | 247 | ||
| @@ -324,13 +324,13 @@ Lisp_Object Vmemory_signal_data; | |||
| 324 | 324 | ||
| 325 | /* Buffer in which we save a copy of the C stack at each GC. */ | 325 | /* Buffer in which we save a copy of the C stack at each GC. */ |
| 326 | 326 | ||
| 327 | char *stack_copy; | 327 | static char *stack_copy; |
| 328 | int stack_copy_size; | 328 | static int stack_copy_size; |
| 329 | 329 | ||
| 330 | /* Non-zero means ignore malloc warnings. Set during initialization. | 330 | /* Non-zero means ignore malloc warnings. Set during initialization. |
| 331 | Currently not used. */ | 331 | Currently not used. */ |
| 332 | 332 | ||
| 333 | int ignore_warnings; | 333 | static int ignore_warnings; |
| 334 | 334 | ||
| 335 | Lisp_Object Qgc_cons_threshold, Qchar_table_extra_slots; | 335 | Lisp_Object Qgc_cons_threshold, Qchar_table_extra_slots; |
| 336 | 336 | ||
| @@ -397,12 +397,12 @@ void refill_memory_reserve (); | |||
| 397 | /* A unique object in pure space used to make some Lisp objects | 397 | /* A unique object in pure space used to make some Lisp objects |
| 398 | on free lists recognizable in O(1). */ | 398 | on free lists recognizable in O(1). */ |
| 399 | 399 | ||
| 400 | Lisp_Object Vdead; | 400 | static Lisp_Object Vdead; |
| 401 | 401 | ||
| 402 | #ifdef GC_MALLOC_CHECK | 402 | #ifdef GC_MALLOC_CHECK |
| 403 | 403 | ||
| 404 | enum mem_type allocated_mem_type; | 404 | enum mem_type allocated_mem_type; |
| 405 | int dont_register_blocks; | 405 | static int dont_register_blocks; |
| 406 | 406 | ||
| 407 | #endif /* GC_MALLOC_CHECK */ | 407 | #endif /* GC_MALLOC_CHECK */ |
| 408 | 408 | ||
| @@ -502,12 +502,12 @@ struct gcpro *gcprolist; | |||
| 502 | /* Addresses of staticpro'd variables. Initialize it to a nonzero | 502 | /* Addresses of staticpro'd variables. Initialize it to a nonzero |
| 503 | value; otherwise some compilers put it into BSS. */ | 503 | value; otherwise some compilers put it into BSS. */ |
| 504 | 504 | ||
| 505 | #define NSTATICS 0x600 | 505 | #define NSTATICS 1280 |
| 506 | Lisp_Object *staticvec[NSTATICS] = {&Vpurify_flag}; | 506 | static Lisp_Object *staticvec[NSTATICS] = {&Vpurify_flag}; |
| 507 | 507 | ||
| 508 | /* Index of next unused slot in staticvec. */ | 508 | /* Index of next unused slot in staticvec. */ |
| 509 | 509 | ||
| 510 | int staticidx = 0; | 510 | static int staticidx = 0; |
| 511 | 511 | ||
| 512 | static POINTER_TYPE *pure_alloc P_ ((size_t, int)); | 512 | static POINTER_TYPE *pure_alloc P_ ((size_t, int)); |
| 513 | 513 | ||
| @@ -1417,7 +1417,7 @@ struct interval_block | |||
| 1417 | /* Current interval block. Its `next' pointer points to older | 1417 | /* Current interval block. Its `next' pointer points to older |
| 1418 | blocks. */ | 1418 | blocks. */ |
| 1419 | 1419 | ||
| 1420 | struct interval_block *interval_block; | 1420 | static struct interval_block *interval_block; |
| 1421 | 1421 | ||
| 1422 | /* Index in interval_block above of the next unused interval | 1422 | /* Index in interval_block above of the next unused interval |
| 1423 | structure. */ | 1423 | structure. */ |
| @@ -1434,7 +1434,7 @@ INTERVAL interval_free_list; | |||
| 1434 | 1434 | ||
| 1435 | /* Total number of interval blocks now in use. */ | 1435 | /* Total number of interval blocks now in use. */ |
| 1436 | 1436 | ||
| 1437 | int n_interval_blocks; | 1437 | static int n_interval_blocks; |
| 1438 | 1438 | ||
| 1439 | 1439 | ||
| 1440 | /* Initialize interval allocation. */ | 1440 | /* Initialize interval allocation. */ |
| @@ -1756,7 +1756,7 @@ static char string_overrun_cookie[GC_STRING_OVERRUN_COOKIE_SIZE] = | |||
| 1756 | 1756 | ||
| 1757 | /* Initialize string allocation. Called from init_alloc_once. */ | 1757 | /* Initialize string allocation. Called from init_alloc_once. */ |
| 1758 | 1758 | ||
| 1759 | void | 1759 | static void |
| 1760 | init_strings () | 1760 | init_strings () |
| 1761 | { | 1761 | { |
| 1762 | total_strings = total_free_strings = total_string_size = 0; | 1762 | total_strings = total_free_strings = total_string_size = 0; |
| @@ -1773,8 +1773,8 @@ init_strings () | |||
| 1773 | 1773 | ||
| 1774 | static int check_string_bytes_count; | 1774 | static int check_string_bytes_count; |
| 1775 | 1775 | ||
| 1776 | void check_string_bytes P_ ((int)); | 1776 | static void check_string_bytes P_ ((int)); |
| 1777 | void check_sblock P_ ((struct sblock *)); | 1777 | static void check_sblock P_ ((struct sblock *)); |
| 1778 | 1778 | ||
| 1779 | #define CHECK_STRING_BYTES(S) STRING_BYTES (S) | 1779 | #define CHECK_STRING_BYTES(S) STRING_BYTES (S) |
| 1780 | 1780 | ||
| @@ -1795,7 +1795,7 @@ string_bytes (s) | |||
| 1795 | 1795 | ||
| 1796 | /* Check validity of Lisp strings' string_bytes member in B. */ | 1796 | /* Check validity of Lisp strings' string_bytes member in B. */ |
| 1797 | 1797 | ||
| 1798 | void | 1798 | static void |
| 1799 | check_sblock (b) | 1799 | check_sblock (b) |
| 1800 | struct sblock *b; | 1800 | struct sblock *b; |
| 1801 | { | 1801 | { |
| @@ -1829,7 +1829,7 @@ check_sblock (b) | |||
| 1829 | non-zero means check all strings, otherwise check only most | 1829 | non-zero means check all strings, otherwise check only most |
| 1830 | recently allocated strings. Used for hunting a bug. */ | 1830 | recently allocated strings. Used for hunting a bug. */ |
| 1831 | 1831 | ||
| 1832 | void | 1832 | static void |
| 1833 | check_string_bytes (all_p) | 1833 | check_string_bytes (all_p) |
| 1834 | int all_p; | 1834 | int all_p; |
| 1835 | { | 1835 | { |
| @@ -2582,7 +2582,7 @@ struct Lisp_Float *float_free_list; | |||
| 2582 | 2582 | ||
| 2583 | /* Initialize float allocation. */ | 2583 | /* Initialize float allocation. */ |
| 2584 | 2584 | ||
| 2585 | void | 2585 | static void |
| 2586 | init_float () | 2586 | init_float () |
| 2587 | { | 2587 | { |
| 2588 | float_block = NULL; | 2588 | float_block = NULL; |
| @@ -2594,7 +2594,7 @@ init_float () | |||
| 2594 | 2594 | ||
| 2595 | /* Explicitly free a float cell by putting it on the free-list. */ | 2595 | /* Explicitly free a float cell by putting it on the free-list. */ |
| 2596 | 2596 | ||
| 2597 | void | 2597 | static void |
| 2598 | free_float (ptr) | 2598 | free_float (ptr) |
| 2599 | struct Lisp_Float *ptr; | 2599 | struct Lisp_Float *ptr; |
| 2600 | { | 2600 | { |
| @@ -2701,12 +2701,12 @@ struct Lisp_Cons *cons_free_list; | |||
| 2701 | 2701 | ||
| 2702 | /* Total number of cons blocks now in use. */ | 2702 | /* Total number of cons blocks now in use. */ |
| 2703 | 2703 | ||
| 2704 | int n_cons_blocks; | 2704 | static int n_cons_blocks; |
| 2705 | 2705 | ||
| 2706 | 2706 | ||
| 2707 | /* Initialize cons allocation. */ | 2707 | /* Initialize cons allocation. */ |
| 2708 | 2708 | ||
| 2709 | void | 2709 | static void |
| 2710 | init_cons () | 2710 | init_cons () |
| 2711 | { | 2711 | { |
| 2712 | cons_block = NULL; | 2712 | cons_block = NULL; |
| @@ -2903,11 +2903,11 @@ DEFUN ("make-list", Fmake_list, Smake_list, 2, 2, 0, | |||
| 2903 | 2903 | ||
| 2904 | /* Singly-linked list of all vectors. */ | 2904 | /* Singly-linked list of all vectors. */ |
| 2905 | 2905 | ||
| 2906 | struct Lisp_Vector *all_vectors; | 2906 | static struct Lisp_Vector *all_vectors; |
| 2907 | 2907 | ||
| 2908 | /* Total number of vector-like objects now in use. */ | 2908 | /* Total number of vector-like objects now in use. */ |
| 2909 | 2909 | ||
| 2910 | int n_vectors; | 2910 | static int n_vectors; |
| 2911 | 2911 | ||
| 2912 | 2912 | ||
| 2913 | /* Value is a pointer to a newly allocated Lisp_Vector structure | 2913 | /* Value is a pointer to a newly allocated Lisp_Vector structure |
| @@ -3157,21 +3157,21 @@ struct symbol_block | |||
| 3157 | /* Current symbol block and index of first unused Lisp_Symbol | 3157 | /* Current symbol block and index of first unused Lisp_Symbol |
| 3158 | structure in it. */ | 3158 | structure in it. */ |
| 3159 | 3159 | ||
| 3160 | struct symbol_block *symbol_block; | 3160 | static struct symbol_block *symbol_block; |
| 3161 | int symbol_block_index; | 3161 | static int symbol_block_index; |
| 3162 | 3162 | ||
| 3163 | /* List of free symbols. */ | 3163 | /* List of free symbols. */ |
| 3164 | 3164 | ||
| 3165 | struct Lisp_Symbol *symbol_free_list; | 3165 | static struct Lisp_Symbol *symbol_free_list; |
| 3166 | 3166 | ||
| 3167 | /* Total number of symbol blocks now in use. */ | 3167 | /* Total number of symbol blocks now in use. */ |
| 3168 | 3168 | ||
| 3169 | int n_symbol_blocks; | 3169 | static int n_symbol_blocks; |
| 3170 | 3170 | ||
| 3171 | 3171 | ||
| 3172 | /* Initialize symbol allocation. */ | 3172 | /* Initialize symbol allocation. */ |
| 3173 | 3173 | ||
| 3174 | void | 3174 | static void |
| 3175 | init_symbol () | 3175 | init_symbol () |
| 3176 | { | 3176 | { |
| 3177 | symbol_block = NULL; | 3177 | symbol_block = NULL; |
| @@ -3253,16 +3253,16 @@ struct marker_block | |||
| 3253 | struct marker_block *next; | 3253 | struct marker_block *next; |
| 3254 | }; | 3254 | }; |
| 3255 | 3255 | ||
| 3256 | struct marker_block *marker_block; | 3256 | static struct marker_block *marker_block; |
| 3257 | int marker_block_index; | 3257 | static int marker_block_index; |
| 3258 | 3258 | ||
| 3259 | union Lisp_Misc *marker_free_list; | 3259 | static union Lisp_Misc *marker_free_list; |
| 3260 | 3260 | ||
| 3261 | /* Total number of marker blocks now in use. */ | 3261 | /* Total number of marker blocks now in use. */ |
| 3262 | 3262 | ||
| 3263 | int n_marker_blocks; | 3263 | static int n_marker_blocks; |
| 3264 | 3264 | ||
| 3265 | void | 3265 | static void |
| 3266 | init_marker () | 3266 | init_marker () |
| 3267 | { | 3267 | { |
| 3268 | marker_block = NULL; | 3268 | marker_block = NULL; |
| @@ -4559,7 +4559,7 @@ mark_stack () | |||
| 4559 | 4559 | ||
| 4560 | 4560 | ||
| 4561 | /* Determine whether it is safe to access memory at address P. */ | 4561 | /* Determine whether it is safe to access memory at address P. */ |
| 4562 | int | 4562 | static int |
| 4563 | valid_pointer_p (p) | 4563 | valid_pointer_p (p) |
| 4564 | void *p; | 4564 | void *p; |
| 4565 | { | 4565 | { |
| @@ -4855,7 +4855,7 @@ pure_cons (car, cdr) | |||
| 4855 | 4855 | ||
| 4856 | /* Value is a float object with value NUM allocated from pure space. */ | 4856 | /* Value is a float object with value NUM allocated from pure space. */ |
| 4857 | 4857 | ||
| 4858 | Lisp_Object | 4858 | static Lisp_Object |
| 4859 | make_pure_float (num) | 4859 | make_pure_float (num) |
| 4860 | double num; | 4860 | double num; |
| 4861 | { | 4861 | { |
| @@ -5381,14 +5381,14 @@ mark_image_cache (f) | |||
| 5381 | all the references contained in it. */ | 5381 | all the references contained in it. */ |
| 5382 | 5382 | ||
| 5383 | #define LAST_MARKED_SIZE 500 | 5383 | #define LAST_MARKED_SIZE 500 |
| 5384 | Lisp_Object last_marked[LAST_MARKED_SIZE]; | 5384 | static Lisp_Object last_marked[LAST_MARKED_SIZE]; |
| 5385 | int last_marked_index; | 5385 | int last_marked_index; |
| 5386 | 5386 | ||
| 5387 | /* For debugging--call abort when we cdr down this many | 5387 | /* For debugging--call abort when we cdr down this many |
| 5388 | links of a list, in mark_object. In debugging, | 5388 | links of a list, in mark_object. In debugging, |
| 5389 | the call to abort will hit a breakpoint. | 5389 | the call to abort will hit a breakpoint. |
| 5390 | Normally this is zero and the check never goes off. */ | 5390 | Normally this is zero and the check never goes off. */ |
| 5391 | int mark_object_loop_halt; | 5391 | static int mark_object_loop_halt; |
| 5392 | 5392 | ||
| 5393 | /* Return non-zero if the object was not yet marked. */ | 5393 | /* Return non-zero if the object was not yet marked. */ |
| 5394 | static int | 5394 | static int |
| @@ -5403,7 +5403,7 @@ mark_vectorlike (ptr) | |||
| 5403 | VECTOR_MARK (ptr); /* Else mark it */ | 5403 | VECTOR_MARK (ptr); /* Else mark it */ |
| 5404 | if (size & PSEUDOVECTOR_FLAG) | 5404 | if (size & PSEUDOVECTOR_FLAG) |
| 5405 | size &= PSEUDOVECTOR_SIZE_MASK; | 5405 | size &= PSEUDOVECTOR_SIZE_MASK; |
| 5406 | 5406 | ||
| 5407 | /* Note that this size is not the memory-footprint size, but only | 5407 | /* Note that this size is not the memory-footprint size, but only |
| 5408 | the number of Lisp_Object fields that we should trace. | 5408 | the number of Lisp_Object fields that we should trace. |
| 5409 | The distinction is used e.g. by Lisp_Process which places extra | 5409 | The distinction is used e.g. by Lisp_Process which places extra |
| @@ -6251,6 +6251,7 @@ Frames, windows, buffers, and subprocesses count as vectors | |||
| 6251 | } | 6251 | } |
| 6252 | 6252 | ||
| 6253 | int suppress_checking; | 6253 | int suppress_checking; |
| 6254 | |||
| 6254 | void | 6255 | void |
| 6255 | die (msg, file, line) | 6256 | die (msg, file, line) |
| 6256 | const char *msg; | 6257 | const char *msg; |