aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorPaul Eggert2011-06-08 12:01:08 -0700
committerPaul Eggert2011-06-08 12:01:08 -0700
commit211a0b2a705753ca0d3f8040f177f0d788298bb6 (patch)
tree4adcbb2d4b0c996405b1874ee8ad0561c5998f17 /src
parent5a25e253b46a4f0def2361b1f34ff6c556f138ba (diff)
downloademacs-211a0b2a705753ca0d3f8040f177f0d788298bb6.tar.gz
emacs-211a0b2a705753ca0d3f8040f177f0d788298bb6.zip
* alloc.c (nzombies, ngcs, max_live, max_zombies): Now EMACS_INT, not 'int'.
Diffstat (limited to 'src')
-rw-r--r--src/ChangeLog1
-rw-r--r--src/alloc.c10
2 files changed, 6 insertions, 5 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index 171d48cbe11..432cea6a624 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -13,6 +13,7 @@
13 (n_vectors, n_symbol_blocks, n_marker_blocks): Remove. 13 (n_vectors, n_symbol_blocks, n_marker_blocks): Remove.
14 These were 'int' variables that could overflow on 64-bit hosts; 14 These were 'int' variables that could overflow on 64-bit hosts;
15 they were never used, so remove them instead of repairing them. 15 they were never used, so remove them instead of repairing them.
16 (nzombies, ngcs, max_live, max_zombies): Now EMACS_INT, not 'int'.
16 17
17 * alloc.c (Fmake_bool_vector): Don't assume vector size fits in int. 18 * alloc.c (Fmake_bool_vector): Don't assume vector size fits in int.
18 (allocate_vectorlike): Check for ptrdiff_t overflow. 19 (allocate_vectorlike): Check for ptrdiff_t overflow.
diff --git a/src/alloc.c b/src/alloc.c
index 1a7d729b29a..dd2e5f4b6ad 100644
--- a/src/alloc.c
+++ b/src/alloc.c
@@ -3905,11 +3905,11 @@ static Lisp_Object zombies[MAX_ZOMBIES];
3905 3905
3906/* Number of zombie objects. */ 3906/* Number of zombie objects. */
3907 3907
3908static int nzombies; 3908static EMACS_INT nzombies;
3909 3909
3910/* Number of garbage collections. */ 3910/* Number of garbage collections. */
3911 3911
3912static int ngcs; 3912static EMACS_INT ngcs;
3913 3913
3914/* Average percentage of zombies per collection. */ 3914/* Average percentage of zombies per collection. */
3915 3915
@@ -3917,7 +3917,7 @@ static double avg_zombies;
3917 3917
3918/* Max. number of live and zombie objects. */ 3918/* Max. number of live and zombie objects. */
3919 3919
3920static int max_live, max_zombies; 3920static EMACS_INT max_live, max_zombies;
3921 3921
3922/* Average number of live objects per GC. */ 3922/* Average number of live objects per GC. */
3923 3923
@@ -3928,7 +3928,7 @@ DEFUN ("gc-status", Fgc_status, Sgc_status, 0, 0, "",
3928 (void) 3928 (void)
3929{ 3929{
3930 Lisp_Object args[8], zombie_list = Qnil; 3930 Lisp_Object args[8], zombie_list = Qnil;
3931 int i; 3931 EMACS_INT i;
3932 for (i = 0; i < nzombies; i++) 3932 for (i = 0; i < nzombies; i++)
3933 zombie_list = Fcons (zombies[i], zombie_list); 3933 zombie_list = Fcons (zombies[i], zombie_list);
3934 args[0] = build_string ("%d GCs, avg live/zombies = %.2f/%.2f (%f%%), max %d/%d\nzombies: %S"); 3934 args[0] = build_string ("%d GCs, avg live/zombies = %.2f/%.2f (%f%%), max %d/%d\nzombies: %S");
@@ -4255,7 +4255,7 @@ dump_zombies (void)
4255{ 4255{
4256 int i; 4256 int i;
4257 4257
4258 fprintf (stderr, "\nZombies kept alive = %d:\n", nzombies); 4258 fprintf (stderr, "\nZombies kept alive = %"pI":\n", nzombies);
4259 for (i = 0; i < min (MAX_ZOMBIES, nzombies); ++i) 4259 for (i = 0; i < min (MAX_ZOMBIES, nzombies); ++i)
4260 { 4260 {
4261 fprintf (stderr, " %d = ", i); 4261 fprintf (stderr, " %d = ", i);