diff options
| author | Paul Eggert | 2011-06-08 11:51:02 -0700 |
|---|---|---|
| committer | Paul Eggert | 2011-06-08 11:51:02 -0700 |
| commit | 5a25e253b46a4f0def2361b1f34ff6c556f138ba (patch) | |
| tree | a279d668f6f49637e787c501b5b9d69137f55af4 /src/alloc.c | |
| parent | c0c5c8ae3686b2fced5aed6e2e15d8222382c4b7 (diff) | |
| download | emacs-5a25e253b46a4f0def2361b1f34ff6c556f138ba.tar.gz emacs-5a25e253b46a4f0def2361b1f34ff6c556f138ba.zip | |
* alloc.c: (n_interval_blocks, n_string_blocks, n_float_blocks, n_cons_blocks)
(n_vectors, n_symbol_blocks, n_marker_blocks): Remove.
These were 'int' variables that could overflow on 64-bit hosts;
they were never used, so remove them instead of repairing them.
Diffstat (limited to 'src/alloc.c')
| -rw-r--r-- | src/alloc.c | 47 |
1 files changed, 1 insertions, 46 deletions
diff --git a/src/alloc.c b/src/alloc.c index 0bfc4c10e74..1a7d729b29a 100644 --- a/src/alloc.c +++ b/src/alloc.c | |||
| @@ -1344,10 +1344,6 @@ static EMACS_INT total_free_intervals, total_intervals; | |||
| 1344 | 1344 | ||
| 1345 | static INTERVAL interval_free_list; | 1345 | static INTERVAL interval_free_list; |
| 1346 | 1346 | ||
| 1347 | /* Total number of interval blocks now in use. */ | ||
| 1348 | |||
| 1349 | static int n_interval_blocks; | ||
| 1350 | |||
| 1351 | 1347 | ||
| 1352 | /* Initialize interval allocation. */ | 1348 | /* Initialize interval allocation. */ |
| 1353 | 1349 | ||
| @@ -1357,7 +1353,6 @@ init_intervals (void) | |||
| 1357 | interval_block = NULL; | 1353 | interval_block = NULL; |
| 1358 | interval_block_index = INTERVAL_BLOCK_SIZE; | 1354 | interval_block_index = INTERVAL_BLOCK_SIZE; |
| 1359 | interval_free_list = 0; | 1355 | interval_free_list = 0; |
| 1360 | n_interval_blocks = 0; | ||
| 1361 | } | 1356 | } |
| 1362 | 1357 | ||
| 1363 | 1358 | ||
| @@ -1389,7 +1384,6 @@ make_interval (void) | |||
| 1389 | newi->next = interval_block; | 1384 | newi->next = interval_block; |
| 1390 | interval_block = newi; | 1385 | interval_block = newi; |
| 1391 | interval_block_index = 0; | 1386 | interval_block_index = 0; |
| 1392 | n_interval_blocks++; | ||
| 1393 | } | 1387 | } |
| 1394 | val = &interval_block->intervals[interval_block_index++]; | 1388 | val = &interval_block->intervals[interval_block_index++]; |
| 1395 | } | 1389 | } |
| @@ -1582,10 +1576,9 @@ static struct sblock *oldest_sblock, *current_sblock; | |||
| 1582 | 1576 | ||
| 1583 | static struct sblock *large_sblocks; | 1577 | static struct sblock *large_sblocks; |
| 1584 | 1578 | ||
| 1585 | /* List of string_block structures, and how many there are. */ | 1579 | /* List of string_block structures. */ |
| 1586 | 1580 | ||
| 1587 | static struct string_block *string_blocks; | 1581 | static struct string_block *string_blocks; |
| 1588 | static int n_string_blocks; | ||
| 1589 | 1582 | ||
| 1590 | /* Free-list of Lisp_Strings. */ | 1583 | /* Free-list of Lisp_Strings. */ |
| 1591 | 1584 | ||
| @@ -1681,7 +1674,6 @@ init_strings (void) | |||
| 1681 | total_strings = total_free_strings = total_string_size = 0; | 1674 | total_strings = total_free_strings = total_string_size = 0; |
| 1682 | oldest_sblock = current_sblock = large_sblocks = NULL; | 1675 | oldest_sblock = current_sblock = large_sblocks = NULL; |
| 1683 | string_blocks = NULL; | 1676 | string_blocks = NULL; |
| 1684 | n_string_blocks = 0; | ||
| 1685 | string_free_list = NULL; | 1677 | string_free_list = NULL; |
| 1686 | empty_unibyte_string = make_pure_string ("", 0, 0, 0); | 1678 | empty_unibyte_string = make_pure_string ("", 0, 0, 0); |
| 1687 | empty_multibyte_string = make_pure_string ("", 0, 0, 1); | 1679 | empty_multibyte_string = make_pure_string ("", 0, 0, 1); |
| @@ -1813,7 +1805,6 @@ allocate_string (void) | |||
| 1813 | memset (b, 0, sizeof *b); | 1805 | memset (b, 0, sizeof *b); |
| 1814 | b->next = string_blocks; | 1806 | b->next = string_blocks; |
| 1815 | string_blocks = b; | 1807 | string_blocks = b; |
| 1816 | ++n_string_blocks; | ||
| 1817 | 1808 | ||
| 1818 | for (i = STRING_BLOCK_SIZE - 1; i >= 0; --i) | 1809 | for (i = STRING_BLOCK_SIZE - 1; i >= 0; --i) |
| 1819 | { | 1810 | { |
| @@ -2042,7 +2033,6 @@ sweep_strings (void) | |||
| 2042 | && total_free_strings > STRING_BLOCK_SIZE) | 2033 | && total_free_strings > STRING_BLOCK_SIZE) |
| 2043 | { | 2034 | { |
| 2044 | lisp_free (b); | 2035 | lisp_free (b); |
| 2045 | --n_string_blocks; | ||
| 2046 | string_free_list = free_list_before; | 2036 | string_free_list = free_list_before; |
| 2047 | } | 2037 | } |
| 2048 | else | 2038 | else |
| @@ -2477,10 +2467,6 @@ static struct float_block *float_block; | |||
| 2477 | 2467 | ||
| 2478 | static int float_block_index; | 2468 | static int float_block_index; |
| 2479 | 2469 | ||
| 2480 | /* Total number of float blocks now in use. */ | ||
| 2481 | |||
| 2482 | static int n_float_blocks; | ||
| 2483 | |||
| 2484 | /* Free-list of Lisp_Floats. */ | 2470 | /* Free-list of Lisp_Floats. */ |
| 2485 | 2471 | ||
| 2486 | static struct Lisp_Float *float_free_list; | 2472 | static struct Lisp_Float *float_free_list; |
| @@ -2494,7 +2480,6 @@ init_float (void) | |||
| 2494 | float_block = NULL; | 2480 | float_block = NULL; |
| 2495 | float_block_index = FLOAT_BLOCK_SIZE; /* Force alloc of new float_block. */ | 2481 | float_block_index = FLOAT_BLOCK_SIZE; /* Force alloc of new float_block. */ |
| 2496 | float_free_list = 0; | 2482 | float_free_list = 0; |
| 2497 | n_float_blocks = 0; | ||
| 2498 | } | 2483 | } |
| 2499 | 2484 | ||
| 2500 | 2485 | ||
| @@ -2528,7 +2513,6 @@ make_float (double float_value) | |||
| 2528 | memset (new->gcmarkbits, 0, sizeof new->gcmarkbits); | 2513 | memset (new->gcmarkbits, 0, sizeof new->gcmarkbits); |
| 2529 | float_block = new; | 2514 | float_block = new; |
| 2530 | float_block_index = 0; | 2515 | float_block_index = 0; |
| 2531 | n_float_blocks++; | ||
| 2532 | } | 2516 | } |
| 2533 | XSETFLOAT (val, &float_block->floats[float_block_index]); | 2517 | XSETFLOAT (val, &float_block->floats[float_block_index]); |
| 2534 | float_block_index++; | 2518 | float_block_index++; |
| @@ -2593,10 +2577,6 @@ static int cons_block_index; | |||
| 2593 | 2577 | ||
| 2594 | static struct Lisp_Cons *cons_free_list; | 2578 | static struct Lisp_Cons *cons_free_list; |
| 2595 | 2579 | ||
| 2596 | /* Total number of cons blocks now in use. */ | ||
| 2597 | |||
| 2598 | static int n_cons_blocks; | ||
| 2599 | |||
| 2600 | 2580 | ||
| 2601 | /* Initialize cons allocation. */ | 2581 | /* Initialize cons allocation. */ |
| 2602 | 2582 | ||
| @@ -2606,7 +2586,6 @@ init_cons (void) | |||
| 2606 | cons_block = NULL; | 2586 | cons_block = NULL; |
| 2607 | cons_block_index = CONS_BLOCK_SIZE; /* Force alloc of new cons_block. */ | 2587 | cons_block_index = CONS_BLOCK_SIZE; /* Force alloc of new cons_block. */ |
| 2608 | cons_free_list = 0; | 2588 | cons_free_list = 0; |
| 2609 | n_cons_blocks = 0; | ||
| 2610 | } | 2589 | } |
| 2611 | 2590 | ||
| 2612 | 2591 | ||
| @@ -2650,7 +2629,6 @@ DEFUN ("cons", Fcons, Scons, 2, 2, 0, | |||
| 2650 | new->next = cons_block; | 2629 | new->next = cons_block; |
| 2651 | cons_block = new; | 2630 | cons_block = new; |
| 2652 | cons_block_index = 0; | 2631 | cons_block_index = 0; |
| 2653 | n_cons_blocks++; | ||
| 2654 | } | 2632 | } |
| 2655 | XSETCONS (val, &cons_block->conses[cons_block_index]); | 2633 | XSETCONS (val, &cons_block->conses[cons_block_index]); |
| 2656 | cons_block_index++; | 2634 | cons_block_index++; |
| @@ -2789,10 +2767,6 @@ DEFUN ("make-list", Fmake_list, Smake_list, 2, 2, 0, | |||
| 2789 | 2767 | ||
| 2790 | static struct Lisp_Vector *all_vectors; | 2768 | static struct Lisp_Vector *all_vectors; |
| 2791 | 2769 | ||
| 2792 | /* Total number of vector-like objects now in use. */ | ||
| 2793 | |||
| 2794 | static int n_vectors; | ||
| 2795 | |||
| 2796 | 2770 | ||
| 2797 | /* Value is a pointer to a newly allocated Lisp_Vector structure | 2771 | /* Value is a pointer to a newly allocated Lisp_Vector structure |
| 2798 | with room for LEN Lisp_Objects. */ | 2772 | with room for LEN Lisp_Objects. */ |
| @@ -2837,7 +2811,6 @@ allocate_vectorlike (EMACS_INT len) | |||
| 2837 | 2811 | ||
| 2838 | MALLOC_UNBLOCK_INPUT; | 2812 | MALLOC_UNBLOCK_INPUT; |
| 2839 | 2813 | ||
| 2840 | ++n_vectors; | ||
| 2841 | return p; | 2814 | return p; |
| 2842 | } | 2815 | } |
| 2843 | 2816 | ||
| @@ -3033,10 +3006,6 @@ static int symbol_block_index; | |||
| 3033 | 3006 | ||
| 3034 | static struct Lisp_Symbol *symbol_free_list; | 3007 | static struct Lisp_Symbol *symbol_free_list; |
| 3035 | 3008 | ||
| 3036 | /* Total number of symbol blocks now in use. */ | ||
| 3037 | |||
| 3038 | static int n_symbol_blocks; | ||
| 3039 | |||
| 3040 | 3009 | ||
| 3041 | /* Initialize symbol allocation. */ | 3010 | /* Initialize symbol allocation. */ |
| 3042 | 3011 | ||
| @@ -3046,7 +3015,6 @@ init_symbol (void) | |||
| 3046 | symbol_block = NULL; | 3015 | symbol_block = NULL; |
| 3047 | symbol_block_index = SYMBOL_BLOCK_SIZE; | 3016 | symbol_block_index = SYMBOL_BLOCK_SIZE; |
| 3048 | symbol_free_list = 0; | 3017 | symbol_free_list = 0; |
| 3049 | n_symbol_blocks = 0; | ||
| 3050 | } | 3018 | } |
| 3051 | 3019 | ||
| 3052 | 3020 | ||
| @@ -3079,7 +3047,6 @@ Its value and function definition are void, and its property list is nil. */) | |||
| 3079 | new->next = symbol_block; | 3047 | new->next = symbol_block; |
| 3080 | symbol_block = new; | 3048 | symbol_block = new; |
| 3081 | symbol_block_index = 0; | 3049 | symbol_block_index = 0; |
| 3082 | n_symbol_blocks++; | ||
| 3083 | } | 3050 | } |
| 3084 | XSETSYMBOL (val, &symbol_block->symbols[symbol_block_index]); | 3051 | XSETSYMBOL (val, &symbol_block->symbols[symbol_block_index]); |
| 3085 | symbol_block_index++; | 3052 | symbol_block_index++; |
| @@ -3127,17 +3094,12 @@ static int marker_block_index; | |||
| 3127 | 3094 | ||
| 3128 | static union Lisp_Misc *marker_free_list; | 3095 | static union Lisp_Misc *marker_free_list; |
| 3129 | 3096 | ||
| 3130 | /* Total number of marker blocks now in use. */ | ||
| 3131 | |||
| 3132 | static int n_marker_blocks; | ||
| 3133 | |||
| 3134 | static void | 3097 | static void |
| 3135 | init_marker (void) | 3098 | init_marker (void) |
| 3136 | { | 3099 | { |
| 3137 | marker_block = NULL; | 3100 | marker_block = NULL; |
| 3138 | marker_block_index = MARKER_BLOCK_SIZE; | 3101 | marker_block_index = MARKER_BLOCK_SIZE; |
| 3139 | marker_free_list = 0; | 3102 | marker_free_list = 0; |
| 3140 | n_marker_blocks = 0; | ||
| 3141 | } | 3103 | } |
| 3142 | 3104 | ||
| 3143 | /* Return a newly allocated Lisp_Misc object, with no substructure. */ | 3105 | /* Return a newly allocated Lisp_Misc object, with no substructure. */ |
| @@ -3166,7 +3128,6 @@ allocate_misc (void) | |||
| 3166 | new->next = marker_block; | 3128 | new->next = marker_block; |
| 3167 | marker_block = new; | 3129 | marker_block = new; |
| 3168 | marker_block_index = 0; | 3130 | marker_block_index = 0; |
| 3169 | n_marker_blocks++; | ||
| 3170 | total_free_markers += MARKER_BLOCK_SIZE; | 3131 | total_free_markers += MARKER_BLOCK_SIZE; |
| 3171 | } | 3132 | } |
| 3172 | XSETMISC (val, &marker_block->markers[marker_block_index]); | 3133 | XSETMISC (val, &marker_block->markers[marker_block_index]); |
| @@ -5815,7 +5776,6 @@ gc_sweep (void) | |||
| 5815 | /* Unhook from the free list. */ | 5776 | /* Unhook from the free list. */ |
| 5816 | cons_free_list = cblk->conses[0].u.chain; | 5777 | cons_free_list = cblk->conses[0].u.chain; |
| 5817 | lisp_align_free (cblk); | 5778 | lisp_align_free (cblk); |
| 5818 | n_cons_blocks--; | ||
| 5819 | } | 5779 | } |
| 5820 | else | 5780 | else |
| 5821 | { | 5781 | { |
| @@ -5862,7 +5822,6 @@ gc_sweep (void) | |||
| 5862 | /* Unhook from the free list. */ | 5822 | /* Unhook from the free list. */ |
| 5863 | float_free_list = fblk->floats[0].u.chain; | 5823 | float_free_list = fblk->floats[0].u.chain; |
| 5864 | lisp_align_free (fblk); | 5824 | lisp_align_free (fblk); |
| 5865 | n_float_blocks--; | ||
| 5866 | } | 5825 | } |
| 5867 | else | 5826 | else |
| 5868 | { | 5827 | { |
| @@ -5912,7 +5871,6 @@ gc_sweep (void) | |||
| 5912 | /* Unhook from the free list. */ | 5871 | /* Unhook from the free list. */ |
| 5913 | interval_free_list = INTERVAL_PARENT (&iblk->intervals[0]); | 5872 | interval_free_list = INTERVAL_PARENT (&iblk->intervals[0]); |
| 5914 | lisp_free (iblk); | 5873 | lisp_free (iblk); |
| 5915 | n_interval_blocks--; | ||
| 5916 | } | 5874 | } |
| 5917 | else | 5875 | else |
| 5918 | { | 5876 | { |
| @@ -5976,7 +5934,6 @@ gc_sweep (void) | |||
| 5976 | /* Unhook from the free list. */ | 5934 | /* Unhook from the free list. */ |
| 5977 | symbol_free_list = sblk->symbols[0].next; | 5935 | symbol_free_list = sblk->symbols[0].next; |
| 5978 | lisp_free (sblk); | 5936 | lisp_free (sblk); |
| 5979 | n_symbol_blocks--; | ||
| 5980 | } | 5937 | } |
| 5981 | else | 5938 | else |
| 5982 | { | 5939 | { |
| @@ -6033,7 +5990,6 @@ gc_sweep (void) | |||
| 6033 | /* Unhook from the free list. */ | 5990 | /* Unhook from the free list. */ |
| 6034 | marker_free_list = mblk->markers[0].u_free.chain; | 5991 | marker_free_list = mblk->markers[0].u_free.chain; |
| 6035 | lisp_free (mblk); | 5992 | lisp_free (mblk); |
| 6036 | n_marker_blocks--; | ||
| 6037 | } | 5993 | } |
| 6038 | else | 5994 | else |
| 6039 | { | 5995 | { |
| @@ -6083,7 +6039,6 @@ gc_sweep (void) | |||
| 6083 | all_vectors = vector->header.next.vector; | 6039 | all_vectors = vector->header.next.vector; |
| 6084 | next = vector->header.next.vector; | 6040 | next = vector->header.next.vector; |
| 6085 | lisp_free (vector); | 6041 | lisp_free (vector); |
| 6086 | n_vectors--; | ||
| 6087 | vector = next; | 6042 | vector = next; |
| 6088 | 6043 | ||
| 6089 | } | 6044 | } |